1806. Minimum Number of Operations to Reinitialize a Permutation
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def reinitializePermutation(self, n: int) -> int:
        perm = list(range(n))
        original = list(range(n))
        steps = 0
        while True:
            perm = [perm[i // 2] if i % 2 == 0 else perm[n // 2 + (i - 1) // 2] for i in range(n)]
            steps += 1
            if perm == original:
                break
        return steps

```
['Python3']