Last active
June 29, 2016 07:33
-
-
Save liondancer/15749b6ca734abafaf030f6794d27eff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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