Greedy
When going left-to-right, we must change \'X\' we encounter. When it happen, we advance our pointer two additional steps, and increment the result.\n\nC++\ncpp\
When going left-to-right, we must change \'X\' we encounter. When it happen, we advance our pointer two additional steps, and increment the result.\n\n**C++**\n```cpp\nint minimumMoves(string s) {\n    int res = 0;\n    for (int i = 0; i < s.size(); i += s[i] == \'X\' ? 3 : 1)\n        res += s[i] == \'X\';\n    return res;\n}\n```
[]