[JAVA] O(n) , 100% efficient solution
```\nclass Solution {\n    public int minimumMoves(String s) {\n        int moves = 0;\n        int i = 0;\n        \n        char[] arr = s.toCharArray();\n   
```\nclass Solution {\n    public int minimumMoves(String s) {\n        int moves = 0;\n        int i = 0;\n        \n        char[] arr = s.toCharArray();\n        \n        while(i < arr.length) {\n            if(arr[i] == \'O\') {\n                i++;\n                continue;\n            }\n            \n            i+=3;\n            moves++;\n        }\n        \n        return moves;\n    }\n}
[]