If each one was repeated only two times it would be easier, since in that case I believe XORing the entire array together would give you the single number
@deepcodes Жыл бұрын
Yes, absolutely!
@mrityunjoybarman9098 Жыл бұрын
you can use ans = ans | (setBits
@deepcodes Жыл бұрын
Yes, good thought!
@roshangupta8161 Жыл бұрын
Very well explained
@deepcodes Жыл бұрын
Thanks for liking
@GuruPrasadShukla Жыл бұрын
i did this one before but didnt got any clue of how to do it with constant space now i know
@sauravchandra10 Жыл бұрын
Instead of calculating pow every time, we can maintain long long shift and multiply it by 2 each time in the loop. It will save time,ig.
@deepcodes Жыл бұрын
Yeah, we can.
@md.marufurrahmanremon309511 ай бұрын
Could you please explain why you took ans as long?