leetcode 89 GRADCODE

来源:互联网 发布:用友医疗软件免费下载 编辑:程序博客网 时间:2024/06/05 15:35
class Solution(object):
    def grayCode(self, n):
        """
        :type n: int
        :rtype: List[int]
        """
        res=[0]
        for i in range(n):
            res+=[x+pow(2,i) for x in reversed(res)]
        return res
0 0