926. Flip String to Monotone Increasing
class Solution:
def minFlipsMonoIncr(self, s: str) -> int:
count_zero = count_one = 0
for i in s:
if i == '0':
count_zero += 1
count_zero = min(count_zero, count_one)
else:
count_one += 1
return min(count_zero, count_one)