Buggy python submission (verdict: Runtime Error):
def conv(s):
  return ord(s) - 97

def sum_list(i):
    return int((i*(i+1))/2)

n = int(input())

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

lss = []
for i in range(n):
    ll = [0] * 25
    lss.append(ll)

for i in range(n):
    for j in range(10):
        lss[i][conv(ls[i][j])]+=1

ans = 0
llss = sorted(lss)

count = 0
for i in range(len(llss)):
    if (i == len(llss)-1):
        break

    if (llss[i] == llss[i+1]):
        count+=1
        if (i == len(llss)-2):
            ans += sum_list(count)
    else:
        ans += sum_list(count)
        count=0

print(ans)


Fixed submission:
def sum_list(i):
    return int((i*(i+1))/2)

n = int(input())
ls = []
for i in range(n):
    ls.append(''.join(sorted(input())))

ls.sort()
ans = 0
count = 0

for i in range(len(ls)):
    if (ls[i] == ls[i+1]):
        count += 1
    else:
        ans += sum_list(count)
        count = 0
    if (i == n-2):
      ans += sum_list(count)
      break

print(ans)

Buggy python submission (verdict: Runtime Error):
def conv(s):
  return ord(s) - 97

def sum_list(i):
    return int((i*(i+1))/2)

n = int(input())

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

lss = []
for i in range(n):
    ll = [0] * 25
    lss.append(ll)

for i in range(n):
    for j in range(10):
        lss[i][conv(ls[i][j])]+=1

ans = 0
llss = sorted(lss)

count = 0
for i in range(len(llss)):
    if (i == len(llss)-1):
        break

    if (llss[i] == llss[i+1]):
        count+=1
        if (i == len(llss)-2):
            ans += sum_list(count)
    else:
        ans += sum_list(count)
        count=0

print(ans)


Fixed submission:
def sum_list(i):
    return int((i*(i+1))/2)

n = int(input())
ls = []
for i in range(n):
    ls.append(''.join(sorted(input())))

ls.sort()
ans = 0
count = 0

for i in range(len(ls)):
    if (ls[i] == ls[i+1]):
        count += 1
    else:
        ans += sum_list(count)
        count = 0
    if (i == n-2):
      ans += sum_list(count)
      break

print(ans)

Buggy python submission (verdict: Runtime Error):
def conv(s):
  return ord(s) - 97

n = int(input())

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

lss = []
for i in range(n):
    ll = [0] * 25
    lss.append(ll)

for i in range(n):
    for j in range(10):
        lss[i][conv(ls[i][j])]+=1

ans = 0
for i in range(n):
    for j in range(n-i-1):
        if lss[i] == lss[i+j+1]:
            ans+=1
print(ans)

Fixed submission:
def sum_list(i):
    return int((i*(i+1))/2)

n = int(input())
ls = []
for i in range(n):
    ls.append(''.join(sorted(input())))

ls.sort()
ans = 0
count = 0

for i in range(len(ls)):
    if (ls[i] == ls[i+1]):
        count += 1
    else:
        ans += sum_list(count)
        count = 0
    if (i == n-2):
      ans += sum_list(count)
      break

print(ans)

Buggy python submission (verdict: Runtime Error):
def conv(s):
  return ord(s) - 97

n = int(input())

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

lss = []
for i in range(n):
    ll = [0] * 25
    lss.append(ll)

for i in range(n):
    for j in range(10):
        lss[i][conv(ls[i][j])]+=1

ans = 0
for i in range(n):
    for j in range(n-i-1):
        if lss[i] == lss[j]:
            ans+=1

print(ans)

Fixed submission:
def sum_list(i):
    return int((i*(i+1))/2)

n = int(input())
ls = []
for i in range(n):
    ls.append(''.join(sorted(input())))

ls.sort()
ans = 0
count = 0

for i in range(len(ls)):
    if (ls[i] == ls[i+1]):
        count += 1
    else:
        ans += sum_list(count)
        count = 0
    if (i == n-2):
      ans += sum_list(count)
      break

print(ans)