python replace
2020年11月25日 14:08
解题思路
纯小白
勿笑
代码
###python3
class Solution:
def bitwiseComplement(self, N: int) -> int:
N = bin(N)[2:]
N = N.replace("0","2")
N = N.replace("1","0")
N = N.replace('2','1')
return int(N,2)