Buggy python submission (verdict: Time Limit Exceeded):
import collections
import math
n = int(input())
a = [0]*n
b = 0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(n):
    t = list(input())
    t.sort()
    m = " ".join(t)
    a[j] = m
c = collections.Counter(a)
for k in range(len(c)):
    if c.most_common()[k][1] > 1:
        b += combinations_count(c.most_common()[k][1], 2)
    else:
        continue
print(b)

Fixed submission:
import collections
import math
n = int(input())
a = [0]*n
b = 0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(n):
    t = list(input())
    t.sort()
    m = " ".join(t)
    a[j] = m
c = collections.Counter(a)
d = list(c)
for k in range(len(d)):
    if c[d[k]] > 1:
        b += combinations_count(c[d[k]], 2)
    else:
        continue
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import math
n = int(input())
ls = list(input() for i in range(n))
a = []
b = 0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(n):
    t = list(ls[j])
    t.sort()
    m = " ".join(t)
    a.append(m)
c = collections.Counter(a)
for k in range(len(c)):
    if c.most_common()[k][1] > 1:
        b += combinations_count(c.most_common()[k][1], 2)
    else:
        continue
print(b)

Fixed submission:
import collections
import math
n = int(input())
a = [0]*n
b = 0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(n):
    t = list(input())
    t.sort()
    m = " ".join(t)
    a[j] = m
c = collections.Counter(a)
d = list(c)
for k in range(len(d)):
    if c[d[k]] > 1:
        b += combinations_count(c[d[k]], 2)
    else:
        continue
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import math
n = int(input())
ls = list(input() for i in range(n))
a = []
b = 0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(n):
    t = list(ls[j])
    t.sort()
    m = " ".join(t)
    a.append(m)
c = collections.Counter(a)
for k in range(len(c)):
    if c.most_common()[k][1] > 1:
        b += combinations_count(c.most_common()[k][1], 2)
    else:
        continue
print(b)

Fixed submission:
import collections
import math
n = int(input())
a = [0]*n
b = 0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(n):
    t = list(input())
    t.sort()
    m = " ".join(t)
    a[j] = m
c = collections.Counter(a)
d = list(c)
for k in range(len(d)):
    if c[d[k]] > 1:
        b += combinations_count(c[d[k]], 2)
    else:
        continue
print(b)

Buggy python submission (verdict: Runtime Error):
import collections
import math
n = int(input())
ls = list(input() for i in range(n))
a = []
b = 0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(n):
    t = list(ls[j])
    t.sort()
    m = " ".join(t)
    a.append(m)
c = collections.Counter(a)
for k in range(len(c)):
    b += combinations_count(c.most_common()[k][1], 2)
print(b)

Fixed submission:
import collections
import math
n = int(input())
a = [0]*n
b = 0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(n):
    t = list(input())
    t.sort()
    m = " ".join(t)
    a[j] = m
c = collections.Counter(a)
d = list(c)
for k in range(len(d)):
    if c[d[k]] > 1:
        b += combinations_count(c[d[k]], 2)
    else:
        continue
print(b)