leetcode 89 GRADCODE

xiaoxiao2021-02-28  85

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
转载请注明原文地址: https://www.6miu.com/read-23954.html

最新回复(0)