Python || Used Helper Function
```\nclass Solution:\n    def check(self,perm,n) :\n        arr =[]\n        for i in range(len(perm)):\n            if i % 2 == 0:\n                arr.append(
```\nclass Solution:\n    def check(self,perm,n) :\n        arr =[]\n        for i in range(len(perm)):\n            if i % 2 == 0:\n                arr.append(perm[i//2])\n            if i % 2 == 1:\n                arr.append(perm[n//2 + (i-1)//2])\n        return arr\n\n    def reinitializePermutation(self, n: int) -> int:\n        perm = []\n        for i in range(n):\n            perm.append(i)\n\n        drr = perm\n        c = 0\n        #print(drr)\n        arr =self.check(perm,n)\n        if arr == drr:\n            return 1\n        else:\n            c = c + 1\n\n        while arr != drr:\n            if arr != perm:\n                perm = []\n                perm = arr\n                arr = self.check(perm,n)\n                c = c + 1\n                if arr == drr:\n                    break\n        return c
['Python']