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

N = int(input())
A = np.array([int(i) for i in input().split()])
ans = 0
for a in A:
    candi = [
        np.sum(np.abs(A - np.ones(N) * (a - 1)) <= 1),
        np.sum(np.abs(A - np.ones(N) * a) <= 1),
        np.sum(np.abs(A - np.ones(N) * (a + 1)) <= 1),
    ]
    ans = max(ans, np.max(candi))
print(ans)


Fixed submission:
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))

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

N = int(input())
A = np.array([int(i) for i in input().split()])
ans = 0
for i in range(max(A) + 1):
    ans = max(ans, np.sum(np.abs(A - np.ones(N) * i) <= 1))
print(ans)


Fixed submission:
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))

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

N = int(input())
A = np.array([int(i) for i in input().split()])
ans = 0
for i in range(max(A) + 1):
    ans = max(ans, np.sum(np.abs(A - np.ones(N) * i) <= 1))
print(ans)


Fixed submission:
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

num_X = 0

for ele in a:
    X_new = 0
    X_new += sum([ 1 for i in a-ele if i == 0 ])
    X_new += sum([ 1 for i in a-ele-1 if i == 0 ])
    X_new += sum([ 1 for i in a-ele+1 if i == 0 ])
    num_X = max(num_X, X_new)

print(num_X)

Fixed submission:
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

num_X = 0

for ele in a:
    X_new = 3*N - np.count_nonzero(a - ele) - np.count_nonzero(a - ele -1) - np.count_nonzero(a - ele +1)
    num_X = max(num_X, X_new)

print(num_X)

Fixed submission:
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

num_X = 0

for ele in a:
    X_new = 0
    X_new += len(a) - np.count_nonzero(a - ele)
    X_new += len(a) - np.count_nonzero(a - ele -1)
    X_new += len(a) - np.count_nonzero(a - ele +1)
    num_X = max(num_X, X_new)

print(num_X)

Fixed submission:
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
temp = input()
a = [int(i) for i in temp.split()]

num_X = 0

for max_new in range(max(a)+2):
    X_new = 0
    X_new += sum([ 1 for ele in a if ele == max_new ])
    X_new += sum([ 1 for ele in a if ele-1 == max_new ])
    X_new += sum([ 1 for ele in a if ele+1 == max_new ])
    num_X = max(num_X, X_new)

print(num_X)

Fixed submission:
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

num_X = 0

for max_new in range(max(a)+2):
    X_new = 0
    X_new += sum([ 1 for ele in a if ele == max_new ])
    X_new += sum([ 1 for ele in a-1 if ele == max_new ])
    X_new += sum([ 1 for ele in a+1 if ele == max_new ])
    num_X = max(num_X, X_new)
    
print(num_X)

Fixed submission:
import numpy as np
N = int(input())
temp = input()
a = np.array([int(i) for i in temp.split()])

list_X = [0]*1000000

for ele in a:
    list_X[ele] += 1
    list_X[ele-1] += 1
    list_X[ele+1] += 1

print(max(list_X))