Created
October 20, 2018 08:23
-
-
Save z0marlin/e67bbbf2530752e47f364c6868dd2f0e to your computer and use it in GitHub Desktop.
WEC codebuddy week3 solution
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
class Solution: | |
def singleNumber(self, A): | |
res=0 | |
count=0 | |
for j in range(64): | |
count = 0 | |
for i in A : | |
if 1<<j & i : | |
count+=1 | |
if count%3 != 0 : | |
res=res|(1<<j) | |
return res | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment