Easy bfs Java
\nclass Solution {\n    public int reinitializePermutation(int n) {\n        Object perm[] = new Object[n];\n        Object b[] = new Object[n];\n        for(in
```\nclass Solution {\n    public int reinitializePermutation(int n) {\n        Object perm[] = new Object[n];\n        Object b[] = new Object[n];\n        for(int i=0;i<n;i++){\n            perm[i] = i;\n            b[i] = i;\n        }\n        int count = 0;\n        while(Arrays.deepEquals(perm,b) == false || count == 0){\n            Object a[] = new Object [n];\n            for(int i=0;i<a.length;i++){\n                if(i%2==0){\n                    a[i] = perm[i/2];\n                } else {\n                    a[i] = perm[(n/2) + (i-1)/2];\n                }\n            }\n            count++;\n            perm = a;\n        }\n        return count;\n    }\n}\n```
[]