C++, Simple intro to greedy
\nint minimumMoves(string s) {\n        int cnt=0;\n        int i=0;\n        while(i<s.size()){\n            if(s[i]==\'O\') i++;\n            else{\n         
```\nint minimumMoves(string s) {\n        int cnt=0;\n        int i=0;\n        while(i<s.size()){\n            if(s[i]==\'O\') i++;\n            else{\n               cnt++;\n                i=i+3;\n            }\n        }\n        return cnt;\n    }\n```\n\nAs the problem is very simple - let me explain something here.\nOne can easily test that - the problem requires a \'minimum\' amount - which is an optmization. But why does this optimization does not need dynamic programming?\n\nFor any string **s**, minimum amount for **s[i]** does not depend on the minumim amount for **s[i-1]**. \nFor any additional **s[i+1]** you need to increase the minimum count.\nSee, this is why this optimization does not require dynamic approach.\n
[]