C++ - 2 Solutions - Beats 100 % - Easy
 # Intuition  \n\n\n\n\n\n# Complexity\n- Time complexity:O(n)\n\n\n- Space complexity:O(1)\n\n\n# Code\n\nclass Solution {\npublic:\n    int minimumMoves(strin
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\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```\nclass Solution {\npublic:\n    int minimumMoves(string s) {\n        int moves = 0 ; \n        int n = s.length() ; \n        int i = 0 ; \n        while (i < n)\n        {\n            if (s[i] == \'X\')\n            {\n                moves ++ ;\n                i += 3 ;\n            }\n            else\n            {\n                i ++ ;\n            }\n        }\n        return moves ; \n    }\n};\n```\n![815a317f-9cdf-46e2-a397-af8869dafa2e_1673498197.3721023.png](https://assets.leetcode.com/users/images/c45dbdd3-b68d-4f5c-ab0a-d66c5f9e927a_1675700798.694205.png)\n
['String', 'Greedy', 'C++']