Buggy python submission (verdict: Runtime Error):
s = [''.join(sorted(input())) for i in range(N)]
 
dic = {}
cnt = 0
for i in range(N):
    if s[i] in dic:
        cnt += dic[s[i]]
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1
print(cnt)
 
 

Fixed submission:
def f(array):
    temp = 'abcdefghijklmnopqrstuvwxyz'
    ret = [0] * len(temp)
    cnt = 0
    for x in array:
        ret[temp.index(x)] += 1
        cnt += 1
        if cnt == 10:
            break
    return ret

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

dic = {}
for i in range(N):
    if s[i] in dic:
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1

cnt = 0
for v in dic.values():
    cnt += v * (v - 1) // 2

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]
check = [False] * N
cnt = 0
for i in range(N - 1):
    part = 0
    if check[i]:
        continue
    for j in range(i + 1, N):
        if check[j]:
            continue
        if s[i] == s[j]:
            part += 1
            check[j] = True
    cnt += (part + 1) * part // 2

print(cnt)


Fixed submission:
def f(array):
    temp = 'abcdefghijklmnopqrstuvwxyz'
    ret = [0] * len(temp)
    cnt = 0
    for x in array:
        ret[temp.index(x)] += 1
        cnt += 1
        if cnt == 10:
            break
    return ret

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

dic = {}
for i in range(N):
    if s[i] in dic:
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1

cnt = 0
for v in dic.values():
    cnt += v * (v - 1) // 2

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
def f(array):
    temp = 'abcdefghijklmnopqrstuvwxyz'
    ret = [0] * len(temp)
    cnt = 0
    for x in array:
        ret[temp.index(x)] += 1
        cnt += 1
        if cnt == 10:
            break
    return ret


N = int(input())
s = [f(input()) for i in range(N)]
check = [False] * N
cnt = 0
for i in range(N - 1):
    part = 0
    if check[i]:
        continue
    for j in range(i + 1, N):
        if check[j]:
            continue
        if s[i] == s[j]:
            part += 1
            check[j] = True
    cnt += (part + 1) * part // 2

print(cnt)


Fixed submission:
def f(array):
    temp = 'abcdefghijklmnopqrstuvwxyz'
    ret = [0] * len(temp)
    cnt = 0
    for x in array:
        ret[temp.index(x)] += 1
        cnt += 1
        if cnt == 10:
            break
    return ret

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

dic = {}
for i in range(N):
    if s[i] in dic:
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1

cnt = 0
for v in dic.values():
    cnt += v * (v - 1) // 2

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = [sorted([x for x in input()]) for i in range(N)]

check = [False] * N
cnt = 0
for i in range(N - 1):
    part = 0
    if check[i]:
        continue
    for j in range(i + 1, N):
        if check[j]:
            continue
        if s[i] == s[j]:
            part += 1
            check[j] = True
    cnt += (part + 1) * part // 2

print(cnt)


Fixed submission:
def f(array):
    temp = 'abcdefghijklmnopqrstuvwxyz'
    ret = [0] * len(temp)
    cnt = 0
    for x in array:
        ret[temp.index(x)] += 1
        cnt += 1
        if cnt == 10:
            break
    return ret

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

dic = {}
for i in range(N):
    if s[i] in dic:
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1

cnt = 0
for v in dic.values():
    cnt += v * (v - 1) // 2

print(cnt)

Buggy python submission (verdict: Runtime Error):

    N = int(input())
    s = [sorted([x for x in input()]) for i in range(N)]
     
    check = [False] * N
    cnt = 0
    for i in range(N - 1):
        part = 0
        if check[i]:
            continue
        for j in range(i + 1, N):
            if check[j]:
                continue
            if s[i] == s[j]:
                part += 1
                check[j] = True
        cnt += (part + 1) * part // 2
     
    print(cnt)

Fixed submission:
def f(array):
    temp = 'abcdefghijklmnopqrstuvwxyz'
    ret = [0] * len(temp)
    cnt = 0
    for x in array:
        ret[temp.index(x)] += 1
        cnt += 1
        if cnt == 10:
            break
    return ret

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

dic = {}
for i in range(N):
    if s[i] in dic:
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1

cnt = 0
for v in dic.values():
    cnt += v * (v - 1) // 2

print(cnt)

Buggy python submission (verdict: Runtime Error):
import my_method as my


N = int(input())
s = [sorted([x for x in input()]) for i in range(N)]

check = [False] * N
cnt = 0
for i in range(N - 1):
    part = 0
    if check[i]:
        continue
    for j in range(i + 1, N):
        if check[j]:
            continue
        if s[i] == s[j]:
            part += 1
            check[j] = True
    cnt += (part + 1) * part // 2

print(cnt)


Fixed submission:
def f(array):
    temp = 'abcdefghijklmnopqrstuvwxyz'
    ret = [0] * len(temp)
    cnt = 0
    for x in array:
        ret[temp.index(x)] += 1
        cnt += 1
        if cnt == 10:
            break
    return ret

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

dic = {}
for i in range(N):
    if s[i] in dic:
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1

cnt = 0
for v in dic.values():
    cnt += v * (v - 1) // 2

print(cnt)