Unique Number - 3 Bitmasking

The question says that no extra space is allowed. But taking a char array is what we are doing and that contributes to extra space?

Also, how do I approach this question if I have never seen this before? Like if a question like this only comes, just never seen it, how do I approach it?

generally n=10^6
and we are using only 64 size array as extra space which is O(1) memory as compare to size of n. So we are saying we are using O(1) memory.

This is one of the standard problem. Just practice all the standard problem for solving a approach to these type of question.

I am asking if we encounter such a problem without ever seeing it, how do we approach it?

Think topicwise.
like can I use xor here
or can I use array here
or can I use map here.
You can go topicwise.
Like In my interview ,a unique problem was asked which I never encountered so I just go topicwise and trying to make a juggad between question nd topic