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

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

    for i in range(a):
        lists[v] += 1
        lists[v+1] += 1
        lists[v-1] += 1

    print(max(lists))    

if __name__ == "__main__":
    solve()


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

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

    for i in a:
        lists[i] += 1
        lists[i+1] += 1
        lists[i-1] += 1

    print(max(lists))    

if __name__ == "__main__":
    solve()

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

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

    for i in range(a):
        lists[v] += 1
        lists[v+1] += 1
        lists[v-1] += 1

    print(max(lists))    

if __name__ = "__main__":
    solve()


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

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

    for i in a:
        lists[i] += 1
        lists[i+1] += 1
        lists[i-1] += 1

    print(max(lists))    

if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
def solve():

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

    m = max(a) 
   # print("max:" + str(m))

    ans = 0
    lists = [0, 0, 0]

    for i in range(N):
        X = a[i]
        tmp = 0
        for k in range(N):
            x = a[k] + 1
            y = a[k] - 1
            z = a[k]
            if X == x or X == y or X == z:
                tmp += 1
        if tmp >= ans:
            ans = tmp
            lists[0] = ans

    ans = 0        

    for i in range(N):
        X = a[i] + 1
        tmp = 0
        for k in range(N):
            x = a[k] + 1
            y = a[k] - 1
            z = a[k]
            if X == x or X == y or X == z:
                tmp += 1
        if tmp >= ans:
            ans = tmp
            lists[1] = ans
    
    ans = 0
            
    for i in range(N):
        X = a[i] - 1
        tmp = 0
        for k in range(N):
            x = a[k] + 1
            y = a[k] - 1
            z = a[k]
            if X == x or X == y or X == z:
                tmp += 1
        if tmp >= ans:
            ans = tmp
            lists[2] = ans

    print(max(lists))


if __name__ == "__main__":
    solve()

                




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

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

    for i in a:
        lists[i] += 1
        lists[i+1] += 1
        lists[i-1] += 1

    print(max(lists))    

if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
def solve():

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

    m = max(a) 
   # print("max:" + str(m))

    ans = 0

    for i in range(m+1):
        tmp = 0
        for k in range(N):
            x = a[k] + 1
            y = a[k] - 1
            z = a[k]
            if i == x or i == y or i == z:
                tmp += 1
        if tmp >= ans:
            ans = tmp

    print(ans)


if __name__ == "__main__":
    solve()

                




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

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

    for i in a:
        lists[i] += 1
        lists[i+1] += 1
        lists[i-1] += 1

    print(max(lists))    

if __name__ == "__main__":
    solve()