Rust | Greedy approach
Analysis:\n\nIf we need to flip an \'X\' at an index i, then any \'X\' at indices i+1 and i+2 will also be converted into a \'O\', should those indices exist.\n
**Analysis:**\n\nIf we need to flip an \'X\' at an index `i`, then any \'X\' at indices `i+1` and `i+2` will also be converted into a \'O\', should those indices exist.\n\nSo greedily, we can flip any \'X\' into a \'O\', and advance the index by 3. Otherwise flip the index by 1.\n\n**Solution:**\n\n```\nimpl Solution {\n    pub fn minimum_moves(s: String) -> i32 {\n        let mut i: usize = 0;\n\n        let mut res: i32 = 0;\n\n        while i < s.len() {\n            let c: char = s.chars().nth(i).unwrap();\n\n            /* If we encounter a \'X\', we need to\n               turn it into a \'O\', this move will also\n               change any \'X\' at index i+1 and i+2 into\n               \'O\' if those indices are valid.\n               After the conversion at index i, so we just\n               advance by i by 3, otherwise advance by 1.\n            */\n            if c == \'X\' {\n                res += 1;\n                i += 3;\n            } else {\n                i += 1;\n            }\n        }\n\n        res\n    }\n}\n```
['Greedy', 'Rust']