Open kimTH65 opened 10 months ago
N,M = map(int,input().split())
S = list(map(str,input().split("0")))
ans = 0
for s in S:
result = 0
b = 0
for i in list(s):
result+= int(i)
if result > 0 and result // len(s) > 0 :
b = result - len(s)
a = len(s) - b - M
if a > 0 :
ans = max(ans,a+b)
else :
ans = max(ans,b)
AtCoder Beginner Contest 332
C - T-shirts