Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int, input().split()))
b.sort()
l = 0
for i in range(1,a+1):
     l = len(b)
     b = [j for j in b if j != i]
     print(l-len(b))

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int, input().split()))
for i in range(1,a):
    n = b.count(i)
    print(n)
    if n>0:
        b = [j for j in b if i != j]
print(0)

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int, input().split()))
for i in range(1,a):
    print(b.count(i))
print(0)

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a = int(input())
    b = list(map(int, input().split()))
    for i in range(1,a):
        print(b.count(i))
    print(0)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a = int(input())
    b = list(map(int, input().split()))
    for i in range(1,a+1):
        print(b.count(i))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a = int(input())
    b = list(map(int, input().split()))
    for i in range(1,a+1):
        print(b.count(i))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a = int(input())
    b = list(map(int, input().split()))
    for i in range(1,a+1):
        print(b.count(i))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a = int(input())
    b = list(map(int, input().split()))
    for i in range(1,a+1):
        n = 0
        for j in b:
            if i == j:
                n = n + 1
        print(n)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a = int(input())
    b = list(map(int, input().split()))
    for i in range(1,a+1):
        n = 0
        for j in b:
            if i == j:
                n = n + 1
        print(n)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()