C# 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```\npublic class Solution {\n    public int ReinitializePermutation(int n) {\n        int[] perm = new int[n];\n        int res=0;\n\n        for(int i=0; i<n; i++){\n            perm[i] = i;\n        }\n\n        while(true){\n            int[] nextPerm = new int[n];\n            bool equal = true;\n            res++;\n\n            for(int i=0; i<n; i++){\n                if((i&1) == 0){\n                    nextPerm[i] = perm[i/2];\n                }\n                else{\n                    nextPerm[i] = perm[n/2 + (i - 1)/2];\n                }\n\n                equal = equal && nextPerm[i] == i;\n            }\n\n            if(equal){\n                return res;\n            }\n\n            perm = nextPerm;\n        }\n\n        return n;\n    }\n}\n```
['Array', 'Math', 'Simulation', 'C#']