qyliang/CodeNanoFix huggingface dataset:
Buggy code:
s = list(input())

lis = []

uq = True

for e in s:
    if e in lis:
        print("no")
        uq = False

    lis.append(e)
if uq:
    print("yes")


Fixed code:
s = list(input())

lis = []

uq = True

for e in s:
    if e in lis:
        print("no")
        uq = False
        break

    lis.append(e)
if uq:
    print("yes")
Buggy code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


S=input()

if len(S)==set(S):
	print("yes")
else:
	print("no")

Fixed code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


S=input()

if len(S)==len(set(S)):
	print("yes")
else:
	print("no")
Buggy code:
S = input()
d = set()

for s in S:
    d.add(s)

if len(S) == d:
    print('yes')
else:
    print('no')

Fixed code:
S = input()
d = set()

for s in S:
    d.add(s)

if len(S) == len(d):
    print('yes')
else:
    print('no')
Buggy code:
# 063 B
import collections
S = input()
if len(S) ==len(collections.Counter(S)):
    print("yes")
else:
    print("No")

Fixed code:
# 063 B
import collections
S = input()
if len(S) ==len(collections.Counter(S)):
    print("yes")
else:
    print("no")
Buggy code:
n = int(input())
s = [int(input()) for i in range(n)]
ans = sum(s)
s.sort
if ans%10 == 0 :
    for i in s:
        if ans%10:
            ans -= i
            break

print(ans)

Fixed code:
n = int(input())
s = [int(input()) for i in range(n)]
ans = sum(s)
s.sort()
if ans%10 == 0 :
    for i in s:
        if i%10:
            ans -= i
            break
    else:
        print(0)
        exit()
print(ans)
Buggy code:
N = int(input())

S = [int(input())for _ in range(N)]
S.sort()

S_all = sum(S)

if S_all % 10 != 0:
    print(S_all)
    exit()

i = 0
while S[i] % 10 == 0:
    i += 1

print(S_all - S[i])

Fixed code:
N = int(input())

S = [int(input())for _ in range(N)]
S.sort()

S_all = sum(S)

if S_all % 10 != 0:
    print(S_all)
    exit()

i = 0
while i < N and S[i] % 10 == 0:
    i += 1

if i != N:
    print(S_all - S[i])
else:
    print(0)
Buggy code:
n=int(input())
s=[int(input()) for i in range(n)]
a=[0]
for i in range(n):
    if s[i]%10!=0:
        a.append(s[i])
        a.pop(0)
if sum(s)%10==0:
    if 0 in a:
        print(0)
    else:
        print(sum(s)-min(a))
else:
    print(sum(s))

Fixed code:
n=int(input())
s=[int(input()) for i in range(n)]
a=[]
for i in range(n):
    if s[i]%10!=0:
        a.append(s[i])
if len(a)==0:
    a.append(0)
if sum(s)%10==0:
    if 0 in a:
        print(0)
    else:
        print(sum(s)-min(a))
else:
    print(sum(s))
Buggy code:
n = int(input())
a = [int(input()) for _ in range(n)]

a.sort()

suma = sum(a)

if suma % 10 != 0:
  print(suma)
else:
  for i in a:
    if i % 10 != 0:
      print(suma - i)


Fixed code:
n = int(input())
a = [int(input()) for _ in range(n)]

a.sort()

suma = sum(a)

if suma % 10 != 0:
  print(suma)
  exit()
else:
  for i in a:
    if i % 10 != 0:
      print(suma - i)
      exit()
print(0)
Buggy code:
n = int(input())

scores = [int(input()) for _ in range(n)]

scores.sort()
sum_scores = sum(scores)

if sum_scores % 10 == 0:
    for score in scores:
        if score % 10:
            print(sum_scores - score)
            exit()
else:
    print(sum_scores)

print(0)

Fixed code:
n = int(input())

scores = [int(input()) for _ in range(n)]

scores.sort()
sum_scores = sum(scores)

if sum_scores % 10 == 0:
    for score in scores:
        if score % 10:
            print(sum_scores - score)
            exit()
else:
    print(sum_scores)
    exit()

print(0)
Buggy code:
N = int(input())
s = [int(input()) for i in range(N)]

s.sort()

ans = sum(s)
for i in range(N):
    if ans%10 != 0:
        break
    elif s[i]%10 != 0:
        ans -= s[i]

print(ans)

Fixed code:
N = int(input())
s = [int(input()) for i in range(N)]

s.sort()

ans = sum(s)
for i in range(N):
    if ans%10 != 0:
        break
    elif s[i]%10 != 0:
        ans -= s[i]

print(ans if ans%10!=0 else 0)
Buggy code:
n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
summ = sum(s)
used = []
if str(summ)[-1] != 0:
  print(summ)
  exit()
for j in range(n):
  for i in range(n):
    if s[i] in used:
      continue
    if str(summ - s[i])[-1] != 0:
      print(summ - s[i])
      exit()
  used.append(s[j])
  summ -= s[j]
print(0)

Fixed code:
n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
summ = sum(s)
used = []
if str(summ)[-1] != '0':
  print(summ)
  exit()
for j in range(n):
  for i in range(n):
    if s[i] in used:
      continue
    if str(summ - s[i])[-1] != '0':
      print(summ - s[i])
      exit()
  used.append(s[j])
  summ -= s[j]
print(0)
Buggy code:
N = int(input())
S = soted([int(input()) for _ in range(N)])

m = 0
for s in S:
  if s % 10 != 0 and m == 0:
    m = s
    break
ans = sum(S)
if ans % 10 != 0:
  print(ans)
elif m != 0:
  print(ans-m)
else:
  print(0)

Fixed code:
N = int(input())
S = sorted([int(input()) for _ in range(N)])
 
m = 0
for s in S:
  if s % 10 != 0 and m == 0:
    m = s
    break
ans = sum(S)
if ans % 10 != 0:
  print(ans)
elif m != 0:
  print(ans-m)
else:
  print(0)
Buggy code:
import sys
input = sys.stdin.readline
import numpy as np
N = int(input())
s = []
for _ in range(N):
    s.append(int(input()))
max_s = sum(s)
if max_s % 10 != 0:
    print(max_s)
    sys.exit()
check = np.array(s)
check %= 10
if np.count_nonzero(s) == 0:
    print(0)
    sys.exit()
else:
    s.sort()
    for i in s:
        if i % 10 != 0:
            print(max_s - i)
            sys.exit()

Fixed code:
import sys
input = sys.stdin.readline
import numpy as np
N = int(input())
s = []
for _ in range(N):
    s.append(int(input()))
max_s = sum(s)
if max_s % 10 != 0:
    print(max_s)
    sys.exit()
check = np.array(s)
check %= 10
if np.count_nonzero(check) == 0:
    print(0)
    sys.exit()
else:
    s.sort()
    for i in s:
        if i % 10 != 0:
            print(max_s - i)
            sys.exit()
Buggy code:
import sys
input = sys.stdin.readline
n=int(input())
s=[int(input()) for i in range(n)]
s.sort()
ans=sum(s)

for i in range(1,n):
    if ans%10!=0:
        print(ans)
        exit()
    else:
        if s[i]%10!=0:
            ans-=s[i]
        if i==n-1:
            print(0)


Fixed code:
import sys
input = sys.stdin.readline
n=int(input())
s=[int(input()) for i in range(n)]
s.sort()
ans=sum(s)

for i in range(n):
    if ans%10!=0:
        print(ans)
        exit()
    else:
        if s[i]%10!=0:
            ans-=s[i]
        if i==n-1:
            print(0)
Buggy code:
n=int(input())
L=sorted([int(input()) for i in range(n)])
S=sum(L)
if S%10!=0:
    print(S)
else:
    for i in range(n):
        if (S-L[i])%10!=0:
            print(S-L[i])
            exit()
print(0)

Fixed code:
n=int(input())
L=sorted([int(input()) for i in range(n)])
S=sum(L)
if S%10!=0:
    print(S)
    exit()
else:
    for i in range(n):
        if (S-L[i])%10!=0:
            print(S-L[i])
            exit()
print(0)
Buggy code:
N=int(input())
s=[int(input()) for _ in range(N)]
ss = [s[i] for i in range(N) if s[i]%10!=0]
if sum(s)%10 != 0:
    print(sum(s))
else:
    print(sum(s)-min(ss))

Fixed code:
N=int(input())
s=[int(input()) for _ in range(N)]
ss = [s[i] for i in range(N) if s[i]%10!=0]
if sum(s)%10 != 0:
    print(sum(s))
else:
    if not ss:
        print(0)
    else:
        print(sum(s) - min(ss))
Buggy code:
N = int(input())
s = []
for i in range(N):
  s.append(int(input()))

s.sort()
ans = sum(s)
if ans % 10 == 0:
  fil = list(filter(lambda x: x % 10 != 0, s))
  if len(s) == 0:
    print(0)
  else:
    print(ans - s[0])
else:
  print(ans)

Fixed code:
N = int(input())
s = []
for i in range(N):
  s.append(int(input()))

s.sort()
ans = sum(s)
if ans % 10 == 0:
  fil = list(filter(lambda x: x % 10 != 0, s))
  if len(fil) == 0:
    print(0)
  else:
    print(ans - fil[0])
else:
  print(ans)
Buggy code:
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
s.sort()
print(sum(s))
if sum(s) % 10 != 0:
    print(sum(s))
else:
    for i in range(n):
        if s[i] % 10 != 0:
            print(sum(s) - s[i])
            exit()
    print(0)

Fixed code:
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
s.sort()
#print(sum(s))
if sum(s) % 10 != 0:
    print(sum(s))
else:
    for i in range(n):
        if s[i] % 10 != 0:
            print(sum(s) - s[i])
            exit()
    print(0)
Buggy code:
N = int(input())
s = []
f = True
for i in range(N):
  s.append(int(input()))
s = sorted(s, reverse = True)
a = sum(s)
if a%10 != 0:
  print(a)
  f = False

if f:
  m = 0
  f = True
  for i in range(N):
    if s[i]%10 != 0:
      f = False
      m = s[i]
      break

  if f:
    print(0)
  else:
    print(a-m)

Fixed code:
N = int(input())
s = []
f = True
for i in range(N):
  s.append(int(input()))
s = sorted(s, reverse = True)
a = sum(s)
if a%10 != 0:
  print(a)
  f = False

if f:
  m = 0
  f = True
  s = sorted(s)
  for i in range(N):
    if s[i]%10 != 0:
      f = False
      m = s[i]
      break

  if f:
    print(0)
  else:
    print(a-m)
Buggy code:
N = int(input())
s = []
for i in range(N):
    s.append(int(input()))
SUM = sum(s)
ans = SUM
i = 0
while(SUM % 10 == 0):
    if i >= len(s):
        break
    if s[i] % 10 != 0:
        ans = SUM - s[i]
        break
    i = i+1
if ans == SUM:
    print(0)
else:
    print(ans)

Fixed code:
N = int(input())
s = []
for i in range(N):
    s.append(int(input()))
SUM = sum(s)
s.sort()
flag = 0
if SUM % 10 != 0:
    flag = 1
ans = SUM
i = 0
while(SUM % 10 == 0):
    if i >= len(s):
        break
    if s[i] % 10 != 0:
        ans = SUM - s[i]
        break
    i = i+1
if ans == SUM and flag ==0:
    print(0)
else:
    print(ans)
Buggy code:
l=sorted(map(int,open(0).read().split()[1:]))
a=sum(l)
for t in l:
 if t%10:print(a-t);exit()
print(0)

Fixed code:
l=sorted(map(int,open(0).read().split()[1:]))
a=sum(l)
if a%10:print(a);exit()
for t in l:
 if t%10:print(a-t);exit()
print(0)
Buggy code:
n=int(input())
l=sorted([int(input()) for _ in range(n)])
s=sum(l)
for i in l[::-1]:
  if i%10>0:k=s-i
print(s if s%10>0 else k)

Fixed code:
n=int(input())
l=sorted([int(input()) for _ in range(n)])
s=sum(l)
k=0
for i in l[::-1]:
  if i%10>0:k=s-i
print(s if s%10>0 else k)
Buggy code:
n=int(input())
l=sorted([int(input()) for i in range(n)])
if sum(l)%10!=0:
  print(sum(l))
else:
  ans=sum(l)
  for i in range(n):
    ans-=l[-1-i]
    if ans%10!=0:
      print(ans)
      quit()
  print(0)

Fixed code:
n=int(input())
l=sorted([int(input()) for i in range(n)])
if sum(l)%10!=0:
  print(sum(l))
else:
  ans=sum(l)
  for i in range(n):
    if l[i]%10!=0:
      ans-=l[i]
      print(ans)
      quit()
  print(0)
Buggy code:
N = int(input())
L = [0] * N
for i in range(N):
    L[i] = int(input())

ten = []
non = []
for i in L:
    if i % 10 == 0:
        ten.append(i)
    else:
        non.append(i)
if (sum(ten) + sum(non))%10 != 0:
    print(sum(ten) + sum(non))
else:
    print((sum(ten) + sum(non))-min(non))

Fixed code:
N = int(input())
L = [0] * N
for i in range(N):
    L[i] = int(input())

ten = []
non = []
for i in L:
    if i % 10 == 0:
        ten.append(i)
    else:
        non.append(i)
if (sum(ten) + sum(non))%10 != 0:
    print(sum(ten) + sum(non))
elif non == []:
    print(0)
else:
    print((sum(ten) + sum(non))-min(non))
Buggy code:
import sys

n = int(input())
s = [int(input()) for i in range(n)]

s.sort()
p = np.sum(s)
if p%10 != 0:
    print(p)
    sys.exit()
for i in s:
    if i % 10 != 0:
        print(p - i)
        sys.exit()
print(0)

Fixed code:
import sys

n = int(input())
s = [int(input()) for i in range(n)]

s.sort()
p = sum(s)
if p%10 != 0:
    print(p)
    sys.exit()
for i in s:
    if i % 10 != 0:
        print(p - i)
        sys.exit()
print(0)
Buggy code:
n = int(input())
#a, b = map(int,input().split())
#l = list(map(int,input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
sl = []
for i in range(n):
    sl.append(int(input()))

total = sum(sl)
sl.sort()

if total % 10 == 0:
    ans = 0
    for i in range(n):
        if (total-sl[i]) % 10 != 0:
            ans = total
            break
else:
    ans = total
print(ans)


Fixed code:
n = int(input())
#a, b = map(int,input().split())
#l = list(map(int,input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
sl = []
for i in range(n):
    sl.append(int(input()))

total = sum(sl)
sl.sort()

if total % 10 == 0:
    ans = 0
    for i in range(n):
        if sl[i]%10!=0:
            ans=total-sl[i]
            break
else:
    ans = total
print(ans)
Buggy code:
N = int(input())
chin = []
sum = 0

for i in range(N):

    x = int(input())
    sum += x

    if x % 10 != 0:
        chin.append(x)

chin.sort()
i = 0

while chin != [] and i < len(chin) and sum % 10 == 0:
    sum -= chin[i]
    i += 1

if sum % 10 == 0:
    print(0)


Fixed code:
N = int(input())
chin = []
sum = 0

for i in range(N):

    x = int(input())
    sum += x

    if x % 10 != 0:
        chin.append(x)

chin.sort()
i = 0

while chin != [] and i < len(chin) and sum % 10 == 0:
    sum -= chin[i]
    i += 1

if sum % 10 == 0:
    print(0)
else:
    print(sum)
Buggy code:
n=int(input())
s=[0]*n
for i in range(n):
  s[i]=int(input())
s.sort()
ans=sum(s)
temp=0
if ans%10==0:
  for i in range(n):
    if s[i]%10==0:
      temp=temp+1
    else:
      print(ans-s[i])
  if temp==n:
    print(0)
else:
  print(ans)

Fixed code:
n=int(input())
s=[0]*n
for i in range(n):
  s[i]=int(input())
s.sort()
ans=sum(s)
temp=0
if ans%10==0:
  for i in range(n):
    if s[i]%10==0:
      temp=temp+1
    else:
      print(ans-s[i])
      break
  if temp==n:
    print(0)
else:
  print(ans)
Buggy code:
def main():
    n = int(input())
    s = [int(input()) for _ in range(n)]
    s.sort()
    s_sum = sum(s)
    if s_sum % 10 != 0:
        print(s_sum)
        exit()
    for es in s:
        s_sum -= es
        if s_sum % 10 != 0:
            print(s_sum)
            exit()
	else:
      print(0)
if __name__ == '__main__':
    main()

Fixed code:
def main():
    n = int(input())
    s = [int(input()) for _ in range(n)]
    s_sum = sum(s)
    s = [i for i in s if i % 10 != 0]
    s.sort()
    if s_sum % 10 != 0:
        print(s_sum)
        exit()
    for es in s:
        if (s_sum - es) % 10 != 0:
            print(s_sum - es)
            exit()
    else:
        print(0)

if __name__ == '__main__':
    main()
Buggy code:
n=int(input())
l=[int(input()) for i in range(n)]
l.sort()
x=sum(l)
if x%10==0:
    for s in l:
        if s%10!=0:
            print(x-s)
            break
    print(0)
else:
    print(x)

Fixed code:
n=int(input())
l=[int(input()) for i in range(n)]
l.sort()
x=sum(l)
ans=0
if x%10==0:
    for s in l:
        if s%10!=0:
            ans=x-s
            break
else:
    ans=x
print(ans)
Buggy code:
def solve(n, s_list):
    max_score = sum(tmp)

    if max_score % 10 != 0:
        return max_score
    else:
        for i in tmp:
            if (max_score - i) % 10 != 0:
                return max_score - i

if __name__ == "__main__":
    n = int(input())
    s_list = sorted([int(input()) for i in range(n)])
    print(solve(n, s_list))

Fixed code:
def solve(n, s_list):
    max_score = sum(s_list)

    if max_score % 10 != 0:
        return max_score
    else:
        for i in s_list:
            if (max_score - i) % 10 != 0:
                return max_score - i
    return 0

if __name__ == "__main__":
    n = int(input())
    s_list = sorted([int(input()) for i in range(n)])
    print(solve(n, s_list))
Buggy code:
n = int(input())
s = []
for i in range(n):
  s.append(int(input()))
m=sum(s)
s.sort()
for x in s:
  if (m-x)%10!=0:
    print(m-x)
    exit()
print(0)


Fixed code:
n=int(input())
s=[int(input()) for i in range(n)]
s.sort()

x=sum(s)
if x%10!=0:
    print(x)
    exit()
    
for i in range(n):
    if s[i]%10!=0:
        x-=s[i]
        print(x)
        exit()
print(0)
Buggy code:
N = int(input().rstrip())
a = []
for i in range(N):
    a.append(int(input().rstrip()))

a.sort()
total = sum(a)

if (a[i] % 10) == 0:
    for i in range(N):
        if (a[i] % 10) != 0:
            total = total - a[i]
            break

print(0 if (total % 10) == 0 else total)


Fixed code:
N = int(input().rstrip())
a = []
for i in range(N):
    a.append(int(input().rstrip()))

a.sort()
total = sum(a)

if (total % 10) == 0:
    for i in range(N):
        if (a[i] % 10) != 0:
            total = total - a[i]
            break

print(0 if (total % 10) == 0 else total)
Buggy code:
import numpy as np

N = int(input())
A = np.array([int(input()) for _ in range(N)])

total = A.sum()
if total%10 == 0:
  if np.any(A%10 != 0):
    total -= A[A%10 != 0].min():
  else:
    total = 0
print(total)    

Fixed code:
import numpy as np

N = int(input())
A = np.array([int(input()) for _ in range(N)])

total = A.sum()
if total%10 == 0:
  if np.any(A%10 != 0):
    total -= A[A%10 != 0].min()
  else:
    total = 0
print(total)
Buggy code:
def main():
    n = int(input())
    test = [int(input()) for i in range(n)]
    score = sum(test)
    test.sort()
    x_test = list(filter(lambda x:x % 10 != 0, test))
    if len(x_test) == 0:
        print(0)
        exit()
    x_test.sort()
    print(score - x_test[0])

if __name__ == '__main__':
    main()


Fixed code:
def main():
    n = int(input())
    test = [int(input()) for i in range(n)]
    score = sum(test)
    test.sort()
    x_test = list(filter(lambda x:x % 10 != 0, test))
    if len(x_test) == 0:
        print(0)
        exit()
    elif score % 10 != 0:
        print(score)
        exit()
    x_test.sort()
    print(score - x_test[0])

if __name__ == '__main__':
    main()
Buggy code:
n = int(input())
s = sorted([int(input()) for _ in range(n)])
ans = sum(s)
for v in s:
  if ans%10!=0:
    print(ans)
    break
  if v%10==0:
    continue
  ans -= v
else:
  print(ans)

Fixed code:
n = int(input())
s = sorted([int(input()) for _ in range(n)])
ans = sum(s)
for v in s:
  if ans%10!=0:
    print(ans)
    break
  if v%10!=0:
    ans -= v
else:
  print(0)
Buggy code:
import sys

N=int(input())
s=[int(input()) for i in range(N)]
num=sum(s)

if num%10!=0:
    print(num)
else:
    for i in range(N):
        s=sorted(s)
        if s[i]%10==0:
            continue
        else:
            print(num-s[i])
            sys.exit()

if len(s)==0:
    print(0)

Fixed code:
import sys
N=int(input())
s=[int(input()) for i in range(N)]
num=sum(s)

if num%10!=0:
    print(num)
else:
    for i in range(N):
        s=sorted(s)
        if s[i]%10==0:
            continue
        else:
            print(num-s[i])
            sys.exit()
    print(0)
Buggy code:
n = int(input())
numbers = list(map(int, [input() for _ in range(n)]))
numbers.sort()
score = sum(numbers)

if score % 10 == 0:
	for i in numbers:
		if i % 10 == 0:
			pass
		else:
			score -= i
			break

print(score)

Fixed code:
n = int(input())
numbers = list(map(int, [input() for _ in range(n)]))
numbers.sort()
score = sum(numbers)

if score % 10 == 0:
	for i in numbers:
		if i % 10 == 0:
			pass
		else:
			score -= i
			break

if score % 10 == 0:
	print(0)
else:
	print(score)
Buggy code:
n = int(input())

s_L = []
for i in range(n):
    s_L.append(int(input()))

ans = sum(s_L)
if ans % 10 != 0:
    print(ans)

s_L = sorted(s_L)

for i in range(n):
    if s_L[i]%10 != 0:
        print(ans-s_L[i])
        exit()

print(0)

Fixed code:
n = int(input())

s_L = []
for i in range(n):
    s_L.append(int(input()))

ans = sum(s_L)
if ans % 10 != 0:
    print(ans)
    exit()

s_L = sorted(s_L)

for i in range(n):
    if s_L[i]%10 != 0:
        print(ans-s_L[i])
        exit()

print(0)
Buggy code:
n = int(input())
s = sorted([int(input()) for _ in range(n)])
sum_s = sum(s)
if sum_s % 10 == 0:
  for i in range(n):
    if s[i] % 10 == 0:
      continue
    else:
      sum_s -= s[i]
      break
print(sum_s)

Fixed code:
n = int(input())
s = sorted([int(input()) for _ in range(n)])
sum_s = sum(s)
if sum_s % 10 == 0:
  for i in range(n):
    if s[i] % 10 == 0:
      continue
    else:
      sum_s -= s[i]
      break
if sum_s % 10 == 0:
  print(0)
else:
  print(sum_s)
Buggy code:
def b(N, s):
    v = sum(s)
    for i in range(N, 0, -1):
        if v % 10 == 0:
            if s[i] % 10:
                v -= s[i]
            continue
        else:
            return a
    return 0
    
N = int(input())
s = []

for _ in range(N):
    s.append(int(input()))
    
s.sort(key=lambda x:-x)

print(b(N, s))

Fixed code:
def b(N, s):
    v = sum(s)
    for i in range(N, 0, -1):
        if v % 10 == 0:
            if s[i-1] % 10:
                v -= s[i-1]
            continue
        else:
            return v
    return 0
    
N = int(input())
s = []

for _ in range(N):
    s.append(int(input()))
    
s.sort(key=lambda x:-x)

print(b(N, s))
Buggy code:
#C Bugged
import numpy as np
a = int(input())
k   = []
k10 = []
s = 0

for j in range(a):
    i = int(input())
    if i % 10 == 0:
        k10.append(i)
        ll = ll + i
    else:
        k.append(i)
c = np.array(k)
s += c.sum()
if s%10==0 and len(k) !=0:
    s = s - k[0]
    s = s + ll
elif s%10 ==0:
    s = 0
    s = s + ll
print(s)

Fixed code:
#C Bugged
import numpy as np
a = int(input())
k   = []
k10 = []
s = 0

for j in range(a):
    i = int(input())
    if i % 10 == 0:
        k10.append(i)
        s += i
    else:
        k.append(i)
k.sort()
c = np.array(k)
l = c.sum()
if l%10==0 and len(k) !=0:
    l = l - c[0]
    s = s + l
elif len(k) == 0:
    s = 0
else:
    s = s + l
print(s)
Buggy code:
N = int(input())
s = [int(input()) for i in range(N)]
sums = sum(s)
others = filter(lambda x: x% 10, s)
if sums % 10:
    print(sums)
elif others:
    print(sums-min(others))
else:
    print(0)

Fixed code:
N = int(input())
s = [int(input()) for i in range(N)]
sums = sum(s)
others = list(filter(lambda x: x % 10, s))
if sums % 10:
    print(sums)
elif others != []:
    print(sums-min(others))
else:
    print(0)
Buggy code:
N = int(input())
S = [int(input()) for _ in range(N)]

rr = []
ans = 0
for i in range(N):
    ans += S[i]
    if S[i]%10!=0:
        rr.append(S[i])

rr.sort()
if ans%10==0:
    if len(rr)>0:
        ans -= r[0]
    else:
        ans = 0

print(ans)



Fixed code:
N = int(input())
S = [int(input()) for _ in range(N)]

r = []
ans = 0
for i in range(N):
    ans += S[i]
    if S[i]%10!=0:
        r.append(S[i])

r.sort()
if ans%10==0:
    if len(r)>0:
        ans -= r[0]
    else:
        ans = 0

print(ans)
Buggy code:
N = int(input())
S = [int(input()) for _ in range(N)]
sumS = sum(S)
T = list(filter(lambda x : x%10!=0, S))
T.sort()
for t in T:
    if sumS%10!=0:
        break
    else:
        sumS -= t
print(sumS)

Fixed code:
N = int(input())
S = [int(input()) for _ in range(N)]
sumS = sum(S)
T = list(filter(lambda x : x%10!=0, S))
T.sort()
if len(T)==0:
    print(0)
else:
    for t in T:
        if sumS%10!=0:
            break
        else:
            sumS -= t
    print(sumS)
Buggy code:
n = int(input())
p = []

for i in range(n):
    p.append(int(input()))

p.sort()

ans = sum(p)
if ans%10==0:
    for i in p:
        if i%10!=0:
            ans -= i
    if ans%10==0:
        print(0)
    else:
        print(ans)
else:
    print(ans)


Fixed code:
n = int(input())
p = []

for i in range(n):
    p.append(int(input()))

p.sort()

ans = sum(p)
if ans%10==0:
    for i in p:
        if i%10!=0:
            ans -= i
            break
    if ans%10==0:
        print(0)
    else:
        print(ans)
else:
    print(ans)
Buggy code:
N = int(input())
s = [int(input()) for i in range(N)]
s.sort()
ans = sum(s)
if ans % 10 != 0:
  print(s)
  exit()
else:
  for i in s:
    if i % 10 != 0:
      print(ans-i)
      exit()
print(0)


Fixed code:
N = int(input())
s = [int(input()) for i in range(N)]
s.sort()
ans = sum(s)
if ans % 10 != 0:
  print(ans)
  exit()
else:
  for i in s:
    if i % 10 != 0:
      print(ans-i)
      exit()
print(0)
Buggy code:
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
a=sorted(a)
S=sum(a)
if S%10!=0:
  print(S)
else:
  for i in range(n):
    if (S-a[i])%10:
      print(S-a[i])
      exit()
print(0)

Fixed code:
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
a=sorted(a)
S=sum(a)
if S%10!=0:
  print(S)
  exit()
else:
  for i in range(n):
    if (S-a[i])%10:
      print(S-a[i])
      exit()
print(0)