C++ Solution || 0ms || 100% Faster || Greedy
Code:\n\n\nclass Solution\n{\npublic:\n    int minimumMoves(string s)\n    {\n        int n = s.length();\n        int k = 0;\n        int i;\n        while (i 
**Code:**\n\n```\nclass Solution\n{\npublic:\n    int minimumMoves(string s)\n    {\n        int n = s.length();\n        int k = 0;\n        int i;\n        while (i < n)\n        {\n            if (s[i] == \'X\')\n            {\n                k++;\n                i += 3;\n            }\n            else\n                i++;\n        }\n        return k;\n    }\n};\n```
['Greedy', 'C', 'C++']