Python solution:   Time:O(N) Space: O(2N)
\ndef reinitializePermutation(self, n: int) -> int:\n\ta,t = [i for i in range(n)]*2, 0\n\twhile True:\n\t\tfor i in range(n):\n\t\t\tif i%2==0:\n\t\t\t\ta[n+i]
```\ndef reinitializePermutation(self, n: int) -> int:\n\ta,t = [i for i in range(n)]*2, 0\n\twhile True:\n\t\tfor i in range(n):\n\t\t\tif i%2==0:\n\t\t\t\ta[n+i]=a[i//2]\n\t\t\telse:\n\t\t\t\ta[n+i]=a[n//2+(i-1)//2]\n\t\tfinish,t = True,t+1\n\t\tfor i in range(n):\n\t\t\ta[i]=a[n+i]\n\t\t\tif a[i]!=i:\n\t\t\t\tfinish=False\n\t\tif finish:\n\t\t\treturn t\n\n\t```
[]