Golang solution with explanation and images
The idea of this solution is if we are on a \'X\' we can move the index up by three and add one to res.\n\nAn example could be:\n\ninput: s = "XXOXXXOOOXOXOXX" 
The idea of this solution is if we are on a `\'X\'` we can move the index up by three and add one to `res`.\n\nAn example could be:\n\n`input: s = "XXOXXXOOOXOXOXX"` *(I tried to capture as many edge cases as I could in this test case)*\n\nWe can start with our index `i = 0`\n\n![](https://i.imgur.com/veKMehQ.png)\n\n`s[i] == \'X\'`, so we can skip the next two values (Skip the values at indexes `1` and `2` because according to the problem we have made `s[0] = \'O\', s[1] = \'O\', s[2] = \'O\'`. We don\'t actually change the values because there is no need) and add one to `res`. So now `i = 3`, `res = 1`.\n\n![](https://i.imgur.com/Kym8Qw1.png)\n\n`s[i] == \'X\'`, so we can do the same thing as the previous `3` values, and skip the next two values. Now we are at `i = 6`, `res = 2`\n\n![](https://i.imgur.com/G0FoLNM.png)\n\n`s[i], s[i + 1]`, and `s[i + 2]` are all `\'O\'`, so I am just going to skip them.\n\n![](https://i.imgur.com/ViDnPbB.png)\n\n`s[i] == \'X\'`, so we can skip the next two values, and add one to `res`. `i == 12`, `res = 3`.\n\n![](https://i.imgur.com/DU17fi0.png)\n\n`s[i] == \'O\'`, so `i++` and continue. `i = 13`, `res = 3`\n\n![](https://i.imgur.com/iw6okPi.png)\n\n`s[i] == \'X\'`, so we can skip the next two values, `i = 15`, `res = 4`\n\nBut now `i >= len(s)`, so we can break the loop and return `res`. \n\n``` go\nfunc minimumMoves(s string) int {\n    res := 0\n    \n    for i := 0; i < len(s); i++ {\n        if s[i] == \'X\' {\n            i += 2\n            res++\n        }\n    }\n    \n    return res\n}\n```
['Go']