Simple java Brute force solution
\nclass Solution {\n    public int reinitializePermutation(int n) {\n        \n        int[] perm = new int[n];\n        int[] orig = new int[n];\n        \n   
```\nclass Solution {\n    public int reinitializePermutation(int n) {\n        \n        int[] perm = new int[n];\n        int[] orig = new int[n];\n        \n        for(int i=0;i<n;i++)\n        {\n            perm[i] = i;\n            orig[i] = i;\n        }\n        \n        int operations = 0;\n        while(true)\n        {\n            operations++;\n            int[] arr= new int[n];\n            for(int i=0;i<n;i++)\n            {\n                if(i%2==0)\n                    arr[i] = perm[i/2];\n                else\n                    arr[i] = perm[n/2 + (i-1)/2];    \n            }\n            \n            perm = arr;\n\n            if(Arrays.equals(orig, perm))\n                return operations;\n        }\n    }\n}\n```
['Java']