Track element 1 | O(N) solution with explanation
\nBasically, we need to track any of the element present in the array if it comes back to its original position. That will give us the solution. For universal s
\nBasically, we need to track any of the element present in the array if it comes back to its original position. That will give us the solution. For universal solution we will track number "1" as it is present in all the even numbered arrays "perm" starting from [0,1].\n\tNotice a number only comes at its original position as all others( can be proven mathematically).\n        0 1 2 3 4 5 6 7 \n        0 4 1 5 2 6 3 7 \n        0 2 4 6 1 3 5 7\n        0 1 2 3 4 5 6 7\n\n```\nclass Solution {\npublic:\n    int reinitializePermutation(int n) {\n\n\n        int ans = 0;\n        int track = 1;\n        \n        do{ \n            track = track%2 ==0? track/2 : n/2 + (track-1)/2;\n            ans ++;\n        }while(track!=1);\n        return ans;\n    }\n};\n```
['C']