<filename>Python/circular-permutation-in-binary-representation.py<gh_stars>0
# Time:  O(2^n)
# Space: O(1)

class Solution(object):
    def circularPermutation(self, n, start):
        """
        :type n: int
        :type start: int
        :rtype: List[int]
        """
        return [start ^ (i>>1) ^ i for i in range(1<<n)]

<filename>Python/circular-permutation-in-binary-representation.py<gh_stars>0
# Time:  O(2^n)
# Space: O(1)

class Solution(object):
    def circularPermutation(self, n, start):
        """
        :type n: int
        :type start: int
        :rtype: List[int]
        """
        return [start ^ (i>>1) ^ i for i in range(1<<n)]

# Time:  O(2^n) # Space: O(1) :type n: int         :type start: int         :rtype: List[int]