Buggy python submission (verdict: Runtime Error):
from collections import Counter
from scipy.special import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
from scipy.special import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# from collections import Counter
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

# sN = [input() for _ in range(N)]
# # counts = [Counter(s) for s in sN]
# # pool = []
# # ans = 0
# # for count in counts:
# #     if count in pool:
# #         ans += 1
# #     else:
# #         pool.append(count)
# # print(pool)
# # # print(get_unique_list(counts))
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        if sorted(s[i]) == sorted(s[j]):
            ans += 1
print(ans)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# from collections import Counter
N = int(input())
sN = [input() for _ in range(N)]
# counts = [Counter(s) for s in sN]
# pool = []
# ans = 0
# for count in counts:
#     if count in pool:
#         ans += 1
#     else:
#         pool.append(count)
# print(pool)
# # print(get_unique_list(counts))
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        if sorted(sN[i]) == sorted(sN[j]):
            ans += 1
print(ans)


Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
sN = [input() for _ in range(N)]
# counts = [Counter(s) for s in sN]
# pool = []
# ans = 0
# for count in counts:
#     if count in pool:
#         ans += 1
#     else:
#         pool.append(count)
# print(pool)
# # print(get_unique_list(counts))
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        if set(sN[i]) == set(sN[j]):
            if Counter(sN[i]) == Counter(sN[j]):
                ans += 1
print(ans)


Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
sN = [input() for _ in range(N)]
counts = [Counter(s) for s in sN]
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        if counts[i] == counts[j]:
            ans += 1
print(ans)


Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
sN = [input() for _ in range(N)]
counts = [Counter(s) for s in sN]
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        if counts[i] == counts[j]:
            ans += 1
print(ans)


Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
ans = 0
for count in Counter(s).values():
    ans += comb(count, 2, exact=True)
print(ans)