( Simple )Python solution based on Cyclic functions
The trick is that the function (referred to as "Operation") in the problem statement is a cyclic function. \n\n\n    def reinitializePermutation(self, n: int) -
The trick is that the function (referred to as "Operation") in the problem statement is a [cyclic function](https://www.google.com/search?client=safari&rls=en&q=cyclic+functions&ie=UTF-8&oe=UTF-8). \n\n```\n    def reinitializePermutation(self, n: int) -> int:\n        p = [x for x in range(0,n)]\n        def f():\n            nonlocal p,n\n            arr = []\n            for i in range(0,n):\n                if i%2 == 0:\n                    arr.append(p[i//2])\n                else:\n                    arr.append(p[n//2 + (i - 1)//2])\n            p = arr\n        og = p.copy()\n        f()\n        counter = 1\n        while(p!=og):\n            f()\n            counter += 1\n        \n        return counter\n```
[]