Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

tmp = set(l)
tmp = list(tmp)
ans = []

for i in range(len(tmp)):
    b = l.count(tmp[i])
    if b%2 != 0:
        ans.append(tmp[i])


print(len(ans))

Fixed submission:
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()

ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]
if cnt%2 != 0:
    ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [0]*n

for i in range(n):
    a = int(input())
    if a not in l:
        l[i] = a
    else:
        l.remove(a)

l = [j for j in l if j != 0]

print(len(l))

Fixed submission:
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()

ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]
if cnt%2 != 0:
    ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []

for _ in range(n):
    a = int(input())
    if a not in l:
        l.append(a)
    else:
        l.remove(a)


print(len(l))

Fixed submission:
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()

ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]
if cnt%2 != 0:
    ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []

for _ in range(n):
    a = int(input())
    if a not in l:
        l.append(a)
    else:
        l.remove(a)


print(len(l))

Fixed submission:
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()

ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]
if cnt%2 != 0:
    ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

memo = []

for i in range(n):
    if l[i] not in memo:
        memo.append(l[i])
    else:
        memo.remove(l[i])

print(len(memo))

Fixed submission:
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()

ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]
if cnt%2 != 0:
    ans += 1

print(ans)