Very Easy Solution | Python3 | Simple To Understand
Approach\nJust Following what the problem description is saying thats it.\n\n# Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) \n\n- S
# Approach\n**Just Following what the problem description is saying thats it.**\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: int) -> int:\n        perm = []\n        for i in range(0, n):\n            perm.append(i)\n\n        newPerm = perm\n        operation = 0\n        while(True):\n            a = []\n            for i in range(len(newPerm)):\n                if i % 2 == 0:\n                    a.append(newPerm[i // 2])\n                \n                elif i % 2 == 1:\n                    a.append(newPerm[n // 2 + (i - 1) // 2])\n\n            operation = operation + 1\n\n            newPerm = a\n\n            if newPerm == perm:\n                return operation\n```\n**Please Upvote if you like the Solution :)**
['Array', 'Math', 'Python3']