find-the-single-repeating-element-in-a-given-array

this one is a variant of http://www.geeksforgeeks.org/find-the-two-repeating-elements-in-a-given-array/

there’s no one behind the curtains except these two

  • if two numbers are equal then their xor operator gives us a zero.

  • xor operator is commutative.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s