Below program is to find the odd occurring number i.e odd time occurred number. I don't understanding execution of findOdd function. Please explain step by step. https://code.sololearn.com/cz48RGbfJxmb/?ref=app
1/27/2021 11:53:47 AM
Giriraj Yalpalwar4 Answers
New AnswerXor operation outputs 1 for operands with bit value 1 and 1 and outputs 0 for (1 and 0) and (0 and 0). Bit representation of 12 is 0001100 If you take another repeating number and perform xor operation between them , for example : 12=>0001100 12=>0001100 Output will be 0000000 So if you see , xor operation nulls repeated numbers ,thereby leaving non repeating number .
Thirt13n I know that and that's what keep the original bit alive. You are not messing with that bit . but wait for others answer.
You can understand this code here is my try: https://code.sololearn.com/crqn7demaUbT/?ref=app
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message