Python Solution
Code
# Code
```python3 []
class Solution:
    def reinitializePermutation(self, n: int) -> int:
        l=[]
        for i in range(0,n):
            l.append(i)
        p=l
        res=0
        f=0
        while(p!=l or f==0):
            f=1
            c=[]
            for i in range(len(p)):
                if(i%2==0):
                    c.append(p[int(i/2)])
                else:
                    c.append(p[int(n/2+(i-1)/2)])
            p=c
            res+=1
        return res
```
['Python3']