Created
September 4, 2019 14:58
-
-
Save jadechip/eb04674e96bbdc0365e5d4c4201f6baf to your computer and use it in GitHub Desktop.
Programming challenges: Odd Occurrences In Array
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 solution(A): | |
result = 0 | |
for num in A: | |
result ^= num | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great resource for understanding the properties of the XOR bitwise operator.