Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = (int(input()))
 
ans = 0
counter_list = []
 
for _ in range(N):
    s = input()
    c = collections.Counter(s)
#    print(c)
#    print(counter_list)
    ans += counter_list.count(c)
 
    counter_list.append(c)
 
print(ans)

Fixed submission:
import collections
N = (int(input()))

ans = 0
counter_list = []

for _ in range(N):
    s = input()
    counter_list.append("".join(sorted(s)))

ans = 0
wordcount = {}
for word in counter_list:
    if word in wordcount:
        wordcount[word] += 1
        ans += (wordcount[word])
    else:
        wordcount[word] = 0

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = (int(input()))

ans = 0
counter_list = []

for _ in range(N):
    s = input()
    c = collections.Counter(s)
#    print(c)
#    print(counter_list)
    ans += counter_list.count(c)

    counter_list.append(c)

print(ans)

Fixed submission:
import collections
N = (int(input()))

ans = 0
counter_list = []

for _ in range(N):
    s = input()
    counter_list.append("".join(sorted(s)))

ans = 0
wordcount = {}
for word in counter_list:
    if word in wordcount:
        wordcount[word] += 1
        ans += (wordcount[word])
    else:
        wordcount[word] = 0

print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- config: utg-8 -*-

n = int(input())
s = [input() for i in range(n)]

sort_list = []

for i in s:
	str_sort_list = sorted(i)
	new_str = ''.join(str_sort_list)
	sort_list.append(new_str)

count = 0
for i in sort_list:
  hoge = sort_list.pop(0)
  chohuku_count = sort_list.count(hoge)
  sort_list.remove(hoge)
  
  sum = 0
  for i in range(chohuku_count+1):
    sum += i
  count += sum
  

print(count)

Fixed submission:
import collections
N = (int(input()))

ans = 0
counter_list = []

for _ in range(N):
    s = input()
    counter_list.append("".join(sorted(s)))

ans = 0
wordcount = {}
for word in counter_list:
    if word in wordcount:
        wordcount[word] += 1
        ans += (wordcount[word])
    else:
        wordcount[word] = 0

print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- config: utg-8 -*-

n = int(input())
s = [input() for i in range(n)]

sort_list = []

for i in s:
	str_sort_list = sorted(i)
	new_str = ''.join(str_sort_list)
	sort_list.append(new_str)

count = 0
for i in sort_list:
  hoge = sort_list.pop(0)
  chohuku_count = sort_list.count(hoge)
  sort_list.remove(hoge)
  
  sum = 0
  for i in range(chohuku_count+1):
    sum += i
  count += chohuku_count
  

print(count)

Fixed submission:
import collections
N = (int(input()))

ans = 0
counter_list = []

for _ in range(N):
    s = input()
    counter_list.append("".join(sorted(s)))

ans = 0
wordcount = {}
for word in counter_list:
    if word in wordcount:
        wordcount[word] += 1
        ans += (wordcount[word])
    else:
        wordcount[word] = 0

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- config: utg-8 -*-

n = int(input())
s = [input() for i in range(n)]

sort_list = []

for i in s:
	str_sort_list = sorted(i)
	new_str = ''.join(str_sort_list)
	sort_list.append(new_str)

count = 0
for i in range(n):
  for j in range(n-i):
    if sort_list[i] == sort_list[j+i] and i!=j+i:
      count += 1

print(count)

Fixed submission:
import collections
N = (int(input()))

ans = 0
counter_list = []

for _ in range(N):
    s = input()
    counter_list.append("".join(sorted(s)))

ans = 0
wordcount = {}
for word in counter_list:
    if word in wordcount:
        wordcount[word] += 1
        ans += (wordcount[word])
    else:
        wordcount[word] = 0

print(ans)