How to incorporate test cases where there are 2 distinct negative numbers. For example -> 1,1,-3,-5
Xor does not give correct output with negatives.
Xor with negatives
I don’t think the input array values can be negative
Not here sir, but the same question was on leetcode too. There the test cases were failing on negative numbers. How to incorporate those?
Okay please send the link of the question. I will see.
It is not written anywhere that the numbers can be negative as well
I submitted the same code that got accepted here on leetcode as well. On leetcode, test cases with negative values failed.
Well binary representation works differently in case of negative numbers. So same logic won’t work.
You have to think of something else.
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.