Skip to content

Instantly share code, notes, and snippets.

@liondancer
Last active June 29, 2016 07:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save liondancer/15749b6ca734abafaf030f6794d27eff to your computer and use it in GitHub Desktop.
def single_number1(arr):
if arr and type(arr) == 'list':
vals = {}
for i in arr:
if i in vals:
vals[i] += 1
else:
vals[i] = 1
for i in arr:
if arr[i] == 1:
return i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment