Skip to content

Instantly share code, notes, and snippets.

@sudoankit
Created October 4, 2019 06:12
Show Gist options
  • Save sudoankit/9c8c2feaaca140f301d4be6dfc61bb68 to your computer and use it in GitHub Desktop.
Save sudoankit/9c8c2feaaca140f301d4be6dfc61bb68 to your computer and use it in GitHub Desktop.
Number Occurring Odd Number of Times in O(n) using hash table
def find_it(seq):
hash = 0
for i in seq:
hash = hash ^ i # bitwise XOR
return hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment