PLs tell mistake in my logic.
Test case fail java doubt
if we xor binary number which is power of 2 with 1, the answer is 1 less than the number. This is not true for the number which is not power of 2
…
no that not correct.
for any even number if u take xor with 1 then the answer will be number+1.
also all even numbrs are not power of 2
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.