Skip to content

Instantly share code, notes, and snippets.

@ganesshkumar
Last active January 2, 2016 00:58
Show Gist options
  • Save ganesshkumar/8226714 to your computer and use it in GitHub Desktop.
Save ganesshkumar/8226714 to your computer and use it in GitHub Desktop.
My pythonic solution to 'Lonely Integer' problem on Hacker Rank (https://www.hackerrank.com/challenges/lonely-integer)
#!/usr/bin/py
# Head ends here
def lonelyinteger(a):
answer = 0
for number in a:
answer = answer ^ number
return answer
# Tail starts here
if __name__ == '__main__':
a = input()
b = map(int, raw_input().strip().split(" "))
print lonelyinteger(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment