a few solutions
Peform a linear scan of the input array A.  For each X seen, skip past it and the next 2 indices (inclusive, so 1 + 2 = 3) and increment the count cnt to be ret
Peform a linear scan of the input array `A`.  For each `X` seen, skip past it and the next 2 indices (inclusive, so 1 + 2 = 3) and increment the count `cnt` to be returned.\n\n---\n\n*Kotlin*\n```\nclass Solution {\n    fun minimumMoves(s: String): Int {\n        var cnt = 0\n        var N = s.length\n        var i = 0\n        while (i < N) {\n            if (s[i] == \'X\') {\n                i += 3; cnt += 1\n            } else {\n                ++i\n            }\n        } \n        return cnt\n    }\n}\n```\n\n*Javascript*\n```\nlet minimumMoves = (s, cnt = 0) => {\n    let N = s.length,\n        i = 0;\n    while (i < N) {\n        if (s[i] == \'X\')\n            i += 3, ++cnt;\n        else\n            ++i;\n    }\n    return cnt;\n};\n```\n\n*Python3*\n```\nclass Solution:\n    def minimumMoves(self, s: str, cnt = 0) -> int:\n        N = len(s)\n        i = 0\n        while i < N:\n            if s[i] == \'X\':\n                i += 3; cnt += 1\n            else:\n                i += 1\n        return cnt\n```\n\n*C++*\n```\nclass Solution {\npublic:\n    int minimumMoves(string s, int cnt = 0) {\n        int N = s.size(),\n            i = 0;\n        while (i < N) {\n            if (s[i] == \'X\')\n                i += 3, ++cnt;\n            else\n                ++i;\n        }\n        return cnt;\n    }\n};\n```
[]