6 lines c++ easy solution | O(n) time
Approach\nwhenever we find an \'X\' we will convert it and the following 2 elements (so, no need to check them anyways)\n\n# Complexity\n- Time complexity:\nO(n
# Approach\nwhenever we find an \'X\' we will convert it and the following 2 elements (so, no need to check them anyways)\n\n# Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    int minimumMoves(string s) {\n        int sum = 0;\n        int sz = s.size();\n        for(int i = 0 ; i <sz ; i++) {\n            while(i<sz && s[i]==\'X\') sum++, i+=3;\n        }\n        return sum;\n    }\n};\n```
['C++']