Java O(n)
\npublic int minimumMoves(String s) {\n\tint result = 0, firstXIndex = -1;\n\tfor(int i=0;i<s.length();i++)\n\t\tif(s.charAt(i) == \'X\' && firstXIndex == -1)\n
```\npublic int minimumMoves(String s) {\n\tint result = 0, firstXIndex = -1;\n\tfor(int i=0;i<s.length();i++)\n\t\tif(s.charAt(i) == \'X\' && firstXIndex == -1)\n\t\t\tfirstXIndex = i;\n\t\telse if(i - firstXIndex == 2 && i>1) {\n\t\t\tresult++; // Convert\n\t\t\tfirstXIndex = -1;\n\t\t}\n\treturn firstXIndex != -1 ? result + 1 : result;\n}\n```
[]