class Solution(object):
def grayCode(self, n):
"""
:type n: int
:rtype: List[int]
"""
if n==0: return [0]
last_level=self.grayCode(n-1)
return last_level+map(lambda x:x+(1<<(n-1)),last_level[::-1])
网友评论