Python (Simple Maths)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def reinitializePermutation(self, n):\n        ans, perm, total = [i for i in range(n)], [i for i in range(n)], 0\n\n        while total == 0 or perm != ans:\n            perm = [perm[i//2] if i%2 == 0 else perm[n//2+(i-1)//2] for i in range(n)]\n            total += 1 \n\n        return total \n```
['Python3']