C++ Easy to understand, no change in string
When we encounter a \'X\' we will make a move, irrespective of the fact that there might be \'O\'. After the move we will move the pointer by 3 steps since we a
### When we encounter a \'X\' we will make a ***move***, irrespective of the fact that there might be \'O\'. After the move we will move the pointer by 3 steps since we are gauranteed that there won\'t be any more \'X\' till the position we have swapped.\n\n```\nint minimumMoves(string s) {\n\tint i = 0, n = s.length(), count = 0;\n\twhile (i < n) {\n\t\tif (s[i] == \'O\')  // If we find \'O\' we simply move the pointer one step\n\t\t\ti++;\n\t\telse\n\t\t\tcount++, i += 3;  // When we find \'X\' we increment the count and move the pointer by 3 steps\n\t}\n\treturn count;\n}\n```\n\n**Time Complexity: O(N)**\n**Space Complexity: O(1)**
['C', 'C++']