easy solution through observation
Intuition\n Describe your first thoughts on how to solve this problem. \n1,n-2 reach their particular position only in last operation\n\n# Approach\n Describe y
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n1,n-2 reach their particular position only in last operation\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\no(no of operations)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int reinitializePermutation(int n) {\n       int x=1,y=1,opr=0;\n       do\n       {\n           if(y%2!=0)\n           {\n               y=(n/2)+(y-1)/2;\n           }\n           else y/=2;\n           opr++;\n       }\n       while(y!=x);\n       return opr;\n    }\n};\n```
['C++']