https://leetcode.com/problems/flip-string-to-monotone-increasing/description/
주어진 s가 증가하게 만드는 최소한의 바꾸는 개수를 반환해라.
class Solution:
def minFlipsMonoIncr(self, s: str) -> int:
onecnt, cnt = 0, 0
for c in s:
if c == '1':
onecnt +=1
else:
if onecnt>=1:
cnt +=1
cnt = min(onecnt,cnt)
return cnt
1의 개수와 1 다음으로 나오는 0의 개수를 비교해서 최소한의 수를 구한다