Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))

l=[0]*10**5+2

for v in a:
    l[v]+=1
    l[v+1]+=1
    l[v+2]+=1

print(max(l))

Fixed submission:
N=int(input())
a=list(map(int,input().split()))

l=[0]*((10**5)+2)

for v in a:
    l[v]+=1
    l[v+1]+=1
    l[v+2]+=1

print(max(l))

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))

l=sorted(a)

# N=10
# l=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
if N>=10**4:
    math.
else:
    pass

ans=1

for i in range(N):
    if i>=1 and l[i]==l[i-1]:
        continue
    else:
        t=l[i]
        for j in range(N-i):
            c=l[i+j]
            if abs(c-t)<=2:
                continue
            else:
                _ans=j
                if _ans>ans:
                    ans=_ans
                else:
                    pass
                break
print(ans)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))

l=[0]*((10**5)+2)

for v in a:
    l[v]+=1
    l[v+1]+=1
    l[v+2]+=1

print(max(l))

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))

l=sorted(a)

# N=10
# l=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
if N>=10**3:
    math.


ans=1

for i in range(N):
    if i>=1 and l[i]==l[i-1]:
        continue
    else:
        t=l[i]
        for j in range(N-i):
            c=l[i+j]
            if abs(c-t)<=2:
                continue
            else:
                _ans=j
                if _ans>ans:
                    ans=_ans
                else:
                    pass
                break
print(ans)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))

l=[0]*((10**5)+2)

for v in a:
    l[v]+=1
    l[v+1]+=1
    l[v+2]+=1

print(max(l))

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))

l=sorted(a)

ans=1
targetindex=0
t=l[targetindex]

for i in range (N-targetindex):
    c=l[targetindex+i]
    _ans=1
    if c-t<=2:
        pass
    else:
        _ans=i
    
        if _ans>ans:
            ans=_ans
            targetindex=targetindex+i
            t=[targetindex]
        else:
            pass
print(ans)


Fixed submission:
N=int(input())
a=list(map(int,input().split()))

l=[0]*((10**5)+2)

for v in a:
    l[v]+=1
    l[v+1]+=1
    l[v+2]+=1

print(max(l))

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))

l=sorted(a)

ans=1
targetindex=0
t=l[targetindex]

for i in range (N-targetindex):
    c=l[targetindex+i]
    _ans=1
    if c-t<=2:
        pass
    else:
        _ans=i
        
    if _ans>ans:
        ans=_ans
        targetindex=targetindex+i
        t=[targetindex]
    else:
        pass
print(ans)


Fixed submission:
N=int(input())
a=list(map(int,input().split()))

l=[0]*((10**5)+2)

for v in a:
    l[v]+=1
    l[v+1]+=1
    l[v+2]+=1

print(max(l))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))

l=sorted(a)

ans=1

for i in range(N):
    t=l[i]
    _ans=0
    for j in range (N-i):
        c=l[i+j]
        if c-t<=2:
            pass
        else:
            _ans=j
            break
    if _ans>ans:
        ans=_ans
    else:
        pass
print(ans)


Fixed submission:
N=int(input())
a=list(map(int,input().split()))

l=[0]*((10**5)+2)

for v in a:
    l[v]+=1
    l[v+1]+=1
    l[v+2]+=1

print(max(l))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N=int(input())
a=list(map(int,input().split()))

r=[]

for _ in a:
    l,m,h=_-1,_,_+1
    _r=[l,m,h]
    r.append(_r)
arr=np.array(r)

ans=0
for i in range (max(a)+2):
    _ans=np.sum(np.count_nonzero(arr==i,axis=1))
    if _ans>ans:
        ans=_ans
print(ans)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))

l=[0]*((10**5)+2)

for v in a:
    l[v]+=1
    l[v+1]+=1
    l[v+2]+=1

print(max(l))