100% faster | C++ solution | simple implementation
\nclass Solution {\npublic:\n    int reinitializePermutation(int n) {\n        //check of 1st number \n        //if 1 is return to it\'s orignal position than s
```\nclass Solution {\npublic:\n    int reinitializePermutation(int n) {\n        //check of 1st number \n        //if 1 is return to it\'s orignal position than similar after that no. of operation perform all number set on that starting position\n        int pos=n/2;\n        int res=1;\n        while(pos!=1)\n        {\n            res++;\n            if(pos%2==0) pos=pos/2; //if 1 set on even position\n            else pos=n/2+(pos-1)/2; //if 1 set on odd position\n        }\n        return res;\n    }\n};\n```
[]