class Solution:
def minFlips(self, target: str) -> int:
answer = 0
for i in range(len(target) - 1):
if target[i+1] != target[i]:
answer += 1
return answer + (target[0] == '1')
class Solution:
def minFlips(self, target: str) -> int:
return sum(target[i] != target[i+1] for i in range(len(target) - 1)) + (target[0] == "1")