You are given a string s consisting of characters 'X' and 'O'.
In one move, you can select s and convert all of them into 'O'.
Return the minimum number of moves needed to convert all characters in s into 'O'.
Note: If a selected group of
consecutive characters already contains 'O', those characters remain'O'.
Constraints:
s.length
s[i] is either 'X' or 'O'.
You are given a string s consisting of characters 'X' and 'O'.
In one move, you can select s and convert all of them into 'O'.
Return the minimum number of moves needed to convert all characters in s into 'O'.
Note: If a selected group of
consecutive characters already contains 'O', those characters remain'O'.
Constraints:
s.length
s[i] is either 'X' or 'O'.