cpp solution 100%faster and 85% space efficient
\n int minimumMoves(string s) \n    {\n        int ans=0;\n        for(int i=0;i<s.length();)\n        {\n            if(s[i]==\'X\')\n            {\n          
```\n int minimumMoves(string s) \n    {\n        int ans=0;\n        for(int i=0;i<s.length();)\n        {\n            if(s[i]==\'X\')\n            {\n               int t=3;\n                while(i<s.length()&&t--)\n                {\n                    s[i]=\'0\';\n                    i++;\n                }\n                ans++;\n            }\n            else\n                i++;\n        }\n        return ans;\n    }\n```
['C']