题目描述:
参考格雷编码:
class Solution: def circularPermutation(self, n: int, start: int) -> List[int]: res = [] for i in range(2 ** n): res.append((i >> 1) ^ i) start = res.index(start) return res[start:] + res[:start]