i am not able to visualize the concept of that que help me.
Unique number 2
I would suggest you to watch the lecture video once again for more clarity.
Step 1: XOR all the numbers. You will be left over with the XOR result of the two unique numbers.
Step 2: Find the position of the rightmost set bit of the result. Say it is i.
Step 3: Pair the given numbers according to the set bits at ith position.(XOR all the numbers whose i’th bit is set) This will give you one unique number.
Step 4: XOR the result of Step 1 with Step 3 and you will get the second unique number.
Say the the numbers are : 2 1 3 5 1 6 3 2
Step 1: Will give the XOR result of 5 and 6 ie 5^6 . It will be 101 ^ 110 = 011
Step 2: So the rightmost set bit of result is at i=0 from left.
Step 3: So pair all the numbers whose last or 0th bit is set.So result will be 1^3^5^1^3= 5 So 5 is one unique number.
Step 4: (Step 1)^(Step 3)= 5^6^5=6 which is the second unique number.
i have already seen it but the video was not clarify the concept perfectly what is the reason behind that thing is
???
please tell me why we do this thing??
Your question is not clear enough. What exactly are you not able to understand here?
You can take some example cases and work out following those steps i have mentioned. It will then be clear.
exactly it was not cleared my doubt.if this que is randomly asked without i studied it then i am not able to solve this.what you and video lecture taught me.even no one able to solve this que who didn’t do this previously.so tell me the right way to understand it.
These are just concepts. Don’t worry about that. No one can solve these questions until they know about these concepts. Just understand the various concepts and practice.
If you have problem in understanding any of the above step then you can mention that. I will try to explain.
I would suggest you to work out with some examples following the above mentioned step. And then mention the step with you have doubts.
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.