Here's the problem : Bitwise Balancing Here's my submission for the code : Code for the problem
The thing is it gives Wrong Answer on Test 11
and that too on the 2577th case
in the 11th test. How are we supposed to debug in these situations when I've practically no idea what is the issue.
P.S. : Please help me find any issues with the code. Greatly appreciated!
Read this https://codeforces.me/blog/entry/80396#comment-665933
You can run your solution on thousands of little test cases locally. From the message you saw, you already know that you sometimes print a number that is not a solution to the equation.
So, write another program that generates valid test cases and a script to run your solution on all these test cases. Add an assert to check that the number you are about to print satisfies the equation. You'll find a small test case that way.