Beats 100% | C++
Approach\n1. Initialize moves to 0 for counting moves.\n\n2. Use a loop to traverse the string.\n\n3. When an \'X\' is found, increment moves and skip the next 
# Approach\n1. Initialize moves to 0 for counting moves.\n\n2. Use a loop to traverse the string.\n\n3. When an \'X\' is found, increment moves and skip the next two characters by moving three steps forward (i += 3).\n\n4. If the character is \'O\', move to the next character.\n\n5. Return the total number of moves.\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumMoves(string s) {\n        int moves = 0;\n        int n = s.size();\n        int i = 0;\n        \n        while(i<n){\n            if(s[i]==\'X\'){\n                s[i]=\'0\';\n                moves++;\n                i+=3;\n            }else{\n                i++;\n            }\n        }\n        return moves;\n    }\n};\n```
['C++']