Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
a_unique = set(a)
b = 0
for i in a_unique:
    c = a.count(i)
    b = b + c * (c - 1) / 2
print(int(b))


Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [''.join(sorted(list(input()))) for i in range(N)]
a_unique = set(a)
b = 0
for i in a_unique:
    c = a.count(i)
    b = b + c * (c - 1) / 2
print(int(b))


Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [''.join(sorted(list(input()))) for i in range(N)]
a_unique = set(a)
b = 0
for i in a_unique:
    c = a.count(i)
    b = b + c * (c - 1) / 2 
print(int(b))

Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [''.join(sorted(list(input()))) for i in range(N)]
b = 0
for i in a:
 b = b + a.count(i) - 1
print(int(b / 2))

Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [sorted(list(input())) for i in range(N)]
b = set(a)
ans = len(a) - len(b)
print(ans)

Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [sorted(list(input())) for i in range(N)]
b = set(a)
print(len(a) - len(b))

Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [sorted(list(input())) for i in range(N)]
b = 0
for i in a:
 b = b + a.count(i) - 1
print(int(b / 2))


Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [sorted(list(input())) for i in range(N)]
b = 0
for i in a:
 b = b + a.count(i) - 1
print(int(b / 2))


Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [sorted(list(int(input()))) for i in range(N)]
b = 0
for i in a:
 b = b + a.count(i)
print(b / 2)

Fixed submission:
from collections import Counter

N = int(input())
a = [''.join(sorted(input())) for i in range(N)]
count = Counter(a).values()
b = 0
for i in count:
    b = b + i * (i-1)
b=int(b/2)
print(b)