Skip to content

Commit

Permalink
476 changed
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Apr 25, 2022
1 parent a12f6f1 commit 1422793
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions E_476_NumberComplement.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
class Solution:
def findComplement(self, num: int) -> int:
i=0
j=0
while(i<num):
i+= 2**j
j=j+1
return i-num

def findComplement(self, num):
i=1
while i<=num:
i=i*2
return (i-1)^num

0 comments on commit 1422793

Please sign in to comment.