✅ 99% beats || Python3 || While loop
Intuition\n\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n\n    Use while.\n\n    1.Assign i pointer to while loop as given words
# Intuition\n![Screenshot from 2023-10-18 14-41-08.png](https://assets.leetcode.com/users/images/037b7735-243f-4693-b292-f01d5443e4a3_1697622117.6472003.png)\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n\n    Use while.\n\n    1.Assign i pointer to while loop as given word`s index.\n\n    2.Ckeck if word`s char is "X", if so incraese i to 3 when it turns out "X" each time otherwise increase 1 and count each operation.\n\n\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def minimumMoves(self, s: str) -> int:\n        counter = 0\n        length = len(s)\n        i = 0\n\n        while i < length:\n\n            if s[i] == "X":\n                counter += 1\n                i += 3\n            else:\n                i += 1\n        return counter\n\n\nobj = Solution()\nprint(obj.minimumMoves(s="OXOXXOXX"))\n\n```
['Python3']