Unique number problem

i have tried that problem but getting unexpected output. here is my code . what is wrong in that ?

intialize ans with first value of array and start taking xor from second value @Raghavsingla522
dont forget to mark resolved and hit like if cleared :smiley:

tried that

but still not getting the correct output.
what to do now ?

@Raghavsingla522 share updated code

@Raghavsingla522 its giving correct maybe you are giving input wrong give like this
5
1 1 2 2 3

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.