Given a binary string s, you may flip any character in s from '0' to '1' or from '1' to '0'. Return the minimum number of flips needed to make s monotone increasing, meaning s can be written as some number of '0' characters followed by some number of '1' characters.
Note: A monotone increasing binary string has no
'1'that appears before a'0'.
Constraints:
s.length
s[i] is either '0' or '1'
Given a binary string s, you may flip any character in s from '0' to '1' or from '1' to '0'. Return the minimum number of flips needed to make s monotone increasing, meaning s can be written as some number of '0' characters followed by some number of '1' characters.
Note: A monotone increasing binary string has no
'1'that appears before a'0'.
Constraints:
s.length
s[i] is either '0' or '1'