Last active
January 2, 2016 00:58
-
-
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)
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
#!/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