c++ | easy to understand | step by step
\n\n# Code\n\nclass Solution {\npublic:\n\tint minimumMoves(string s) {\n\t\tint n = s.size();\n\t\tint ans = 0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tif(s[i] == \'
\n\n# Code\n```\nclass Solution {\npublic:\n\tint minimumMoves(string s) {\n\t\tint n = s.size();\n\t\tint ans = 0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\tif(s[i] == \'X\'){\n\t\t\t\tans++;\n\t\t\t\ti+=2;\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}\n};\n```
['C++']