Buggy python submission (verdict: Runtime Error):
# じゃあ全部保存していってやるよ
n = int(input())
d = {}
arr = []
for _ in range(n):
    x = list(sorted(input()))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)


Fixed submission:
# じゃあ全部保存していってやるよ
# atcoderのpython3のバージョンが古すぎて(3.4.3)TypeError: unhashable type: 'list'なるのでため息つきながら直した

n = int(input())
d = {}
arr = []
for _ in range(n):
    x = "".join(list(map(str, list(sorted(input())))))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)

Buggy python submission (verdict: Runtime Error):
# じゃあ全部保存していってやるよ
n = int(input())
d = {}
arr = []
for _ in range(n):
    x = list(sorted(input()))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)


Fixed submission:
# じゃあ全部保存していってやるよ
# atcoderのpython3のバージョンが古すぎて(3.4.3)TypeError: unhashable type: 'list'なるのでため息つきながら直した

n = int(input())
d = {}
arr = []
for _ in range(n):
    x = "".join(list(map(str, list(sorted(input())))))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)

Buggy python submission (verdict: Runtime Error):
# 前の提出だとTLEなっちゃった
# じゃあ全部保存していってやるよ
n = int(input())
d = {}
arr = []
for _ in range(n):
    x = list(sorted(input()))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)


Fixed submission:
# じゃあ全部保存していってやるよ
# atcoderのpython3のバージョンが古すぎて(3.4.3)TypeError: unhashable type: 'list'なるのでため息つきながら直した

n = int(input())
d = {}
arr = []
for _ in range(n):
    x = "".join(list(map(str, list(sorted(input())))))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
# ソートして全探索

n = int(input())
arr = []
for _ in range(n):
    arr.append(list(sorted(input())))

c = 0
for i in range(n - 1, -1, -1):
    for j in range(i - 1, -1, -1):
        if arr[i] == arr[j]:
            c += 1

print(c)


Fixed submission:
# じゃあ全部保存していってやるよ
# atcoderのpython3のバージョンが古すぎて(3.4.3)TypeError: unhashable type: 'list'なるのでため息つきながら直した

n = int(input())
d = {}
arr = []
for _ in range(n):
    x = "".join(list(map(str, list(sorted(input())))))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
# ソートして全探索

n = int(input())
arr = []
for _ in range(n):
    arr.append(list(sorted(input())))

c = 0
for i in range(n - 1, -1, -1):
    for j in range(i - 1, -1, -1):
        if arr[i] == arr[j]:
            c += 1

print(c)


Fixed submission:
# じゃあ全部保存していってやるよ
# atcoderのpython3のバージョンが古すぎて(3.4.3)TypeError: unhashable type: 'list'なるのでため息つきながら直した

n = int(input())
d = {}
arr = []
for _ in range(n):
    x = "".join(list(map(str, list(sorted(input())))))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)