← 返回 linkedin 的题目列表Flip String to Monotone Increasing
类型:online_judge
Given a binary string, you can flip any '0' to '1' or '1' to '0' in order to make the string monotone increasing. Calculate and return the minimum number of flips to make the string monotone increasing.
Example Input:
S = "00110"
Example Output:
1
Constraints:
The length of the string is in the range [1, 10^5].
Example
Input
00110