3 line of CPP code
\n\n# Complexity\n- Time complexity:O(n);\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(1);\n Add your space complexity here, e.g. O(n) \n
\n\n# Complexity\n- Time complexity:O(n);\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1);\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n      \n\n\n\n    int reinitializePermutation(int n) {\n\n        \n        int count = 0, i = 1;\n        while (count == 0 || i > 1) {\n            i = i * 2 % (n - 1);\n            count++;\n        }\n        return count;\n  \n    }\n};\n```
['C++']