Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

ans = 0

for i in range(0,len(h),2):
    ans = max(ans,sum(h[i:i+k*2+1]))
    
print(ans)

Fixed submission:
# coding: utf-8
# Your code here!

import numpy as np

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

h = np.array(h)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,np.sum(h[i:i+k*2+1]))
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!

import numpy as np

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

h = np.array(h)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,sum(h[i:i+k*2+1]))
    
print(ans)

Fixed submission:
# coding: utf-8
# Your code here!

import numpy as np

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

h = np.array(h)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,np.sum(h[i:i+k*2+1]))
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!

import time

t = time.time()
n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,sum(h[i:i+k*2+1]))
    
print(ans)

Fixed submission:
# coding: utf-8
# Your code here!

import numpy as np

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

h = np.array(h)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,np.sum(h[i:i+k*2+1]))
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,sum(h[i:i+k*2+1]))
    
print(ans)


Fixed submission:
# coding: utf-8
# Your code here!

import numpy as np

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

h = np.array(h)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,np.sum(h[i:i+k*2+1]))
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
        
    tmp+=1
h.append(tmp)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,sum(h[i:i+k*2+1]))
    ans = max(ans,sum(h[i+1:i+k*2+1]))

print(ans)

Fixed submission:
# coding: utf-8
# Your code here!

import numpy as np

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

h = np.array(h)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,np.sum(h[i:i+k*2+1]))
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
        
    tmp+=1
h.append(tmp)
h.append(0)
h.append(0)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,sum(h[i:i+k*2+1]))

for i in range(1,max(len(h),len(h)-k),2):
    ans = max(ans,sum(h[i:i+k*2]))

print(ans)

Fixed submission:
# coding: utf-8
# Your code here!

import numpy as np

n,k = map(int,input().split())

s = input()

now = s[0]
tmp = 0

h = []
if s[0]=="0":
    h.append(0)

for i in s:
    if i != now:
        now = i
        h.append(tmp)
        tmp=0
    tmp+=1
h.append(tmp)

h = np.array(h)

ans = 0

for i in range(0,max(len(h),len(h)-k),2):
    ans = max(ans,np.sum(h[i:i+k*2+1]))
    
print(ans)