c++ faster than 100% easy solution  commented
\n\nclass Solution {\npublic:\n    int reinitializePermutation(int n) {\n      //you need to permute according to the question and count the number of steps req
```\n\n```class Solution {\npublic:\n    int reinitializePermutation(int n) {\n      //you need to permute according to the question and count the number of steps required till index come become 1 because if we will fix the position of 1 then others will automatically occupy its position.\n        int indexof1=n/2;\n      int ans=1;\n      while(indexof1!=1)\n      {\n        //according to given question if indexof1 is odd the it will give remainder 1 so we will convert indecxof1->n/2+(indexof1)/2 else if it is even then we will just divide it by 2.\n        indexof1=(indexof1%2)*n/2+indexof1/2;\n        ans++;\n      }return ans;\n    }\n};\ndo upvote if you find it useful......
['C', 'C++']