LovePinkLol-Python Programming
Saturday, November 25, 2017
476. Number Complement
class Solution:
def findComplement(self, num):
"""
:type num: int
:rtype: int
"""
return int((len(bin(num))-2)*"1", 2)^num
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment