Java Solution || Arrays Clone method
Simple simulation of the given problem statement\n\n\nclass Solution {\n    public int reinitializePermutation(int n) {\n        int [] perm = new int[n];\n    
Simple simulation of the given problem statement\n\n```\nclass Solution {\n    public int reinitializePermutation(int n) {\n        int [] perm = new int[n];\n        int count = 0;\n        \n         int b[] = new int[n];\n        for(int i = 0; i<n; i++){\n            perm[i] = i;\n            b[i] = i;\n            \n        }\n       \n        int[] arr = new int[n];\n        while(!Arrays.equals(b, perm) || count == 0){\n        for(int i =0; i<n; i++){\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        }\n            perm = arr.clone();\n          \n        count++;\n    }\n        return count;\n    }\n}\n```
['Java']