Java Simple solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int reinitializePermutation(int n) {\n        \n        List<Integer> list =IntStream.range(0,n).boxed().collect(Collectors.toList());\n        List<Integer> listin=new ArrayList<>();\n        listin.addAll(list);\n        int count=0;\n        int k=1;\n        while(k!=0) {\n            count++;\n            List<Integer> list2=new ArrayList<>();\n\n            for (int i = 0; i < n; i++) {\n                if (i % 2 == 0) list2.add(list.get(i / 2));\n                else\n                    list2.add(list.get(n / 2 + (i - 1) / 2));\n            }\n\n            if(list2.equals(listin))\n            {\n                return count;\n            }\n\n            list=list2;\n            list2=null;\n        }\n        return 0;\n    }\n}\n```
['Java']