Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
a = []
b = []
c = np.array([[0]*26]*N)
count = 0
for i in range(N):
    a.append(input())

for i in range(N):
    b = a[i]
    for j in range(10):
        if b[j] == 'a':
            c[i][0] +=1
        elif b[j] == 'b':
            c[i][1] +=1
        elif b[j] == 'c':
            c[i][2] +=1
        elif b[j] == 'd':
            c[i][3] +=1
        elif b[j] == 'e':
            c[i][4] +=1
        elif b[j] == 'f':
            c[i][5] +=1
        elif b[j] == 'g':
            c[i][6] +=1
        elif b[j] == 'h':
            c[i][7] +=1
        elif b[j] == 'i':
            c[i][8] +=1
        elif b[j] == 'j':
            c[i][9] +=1
        elif b[j] == 'k':
            c[i][10] +=1
        elif b[j] == 'l':
            c[i][11] +=1
        elif b[j] == 'm':
            c[i][12] +=1
        elif b[j] == 'n':
            c[i][13] +=1
        elif b[j] == 'o':
            c[i][14] +=1
        elif b[j] == 'p':
            c[i][15] +=1
        elif b[j] == 'q':
            c[i][16] +=1
        elif b[j] == 'r':
            c[i][17] +=1
        elif b[j] == 's':
            c[i][18] +=1
        elif b[j] == 't':
            c[i][19] +=1
        elif b[j] == 'u':
            c[i][20] +=1
        elif b[j] == 'v':
            c[i][21] +=1
        elif b[j] == 'w':
            c[i][22] +=1
        elif b[j] == 'x':
            c[i][23] +=1
        elif b[j] == 'w':
            c[i][24] +=1
        elif b[j] == 'z':
            c[i][25] +=1
for i in range(N):
    for j in range(1,N):
        if i < j:
            if c[i].all!=0:
                if c[j].all!=0:
                    if (c[i] == c[j]).all():
                        count += 1
    
print(count)

Fixed submission:
N = int(input())
s = list(list(input())for i in range(N))
count = 1
ans = 0
for i in range(N):
    s[i].sort()
s.sort()
for i in range(0,N-1):
    if s[i] == s[i+1]:
        ans += count
        count += 1
    else:
        count = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
a = []
b = []
c = np.array([[0]*26,[0]*26,[0]*26])
count = 0
for i in range(N):
    a.append(input())

for i in range(N):
    b = a[i]
    for j in range(10):
        if b[j] == 'a':
            c[i][0] +=1
        elif b[j] == 'b':
            c[i][1] +=1
        elif b[j] == 'c':
            c[i][2] +=1
        elif b[j] == 'd':
            c[i][3] +=1
        elif b[j] == 'e':
            c[i][4] +=1
        elif b[j] == 'f':
            c[i][5] +=1
        elif b[j] == 'g':
            c[i][6] +=1
        elif b[j] == 'h':
            c[i][7] +=1
        elif b[j] == 'i':
            c[i][8] +=1
        elif b[j] == 'j':
            c[i][9] +=1
        elif b[j] == 'k':
            c[i][10] +=1
        elif b[j] == 'l':
            c[i][11] +=1
        elif b[j] == 'm':
            c[i][12] +=1
        elif b[j] == 'n':
            c[i][13] +=1
        elif b[j] == 'o':
            c[i][14] +=1
        elif b[j] == 'p':
            c[i][15] +=1
        elif b[j] == 'q':
            c[i][16] +=1
        elif b[j] == 'r':
            c[i][17] +=1
        elif b[j] == 's':
            c[i][18] +=1
        elif b[j] == 't':
            c[i][19] +=1
        elif b[j] == 'u':
            c[i][20] +=1
        elif b[j] == 'v':
            c[i][21] +=1
        elif b[j] == 'w':
            c[i][22] +=1
        elif b[j] == 'x':
            c[i][23] +=1
        elif b[j] == 'w':
            c[i][24] +=1
        elif b[j] == 'z':
            c[i][25] +=1
for i in range(N):
    for j in range(1,N):
        if i != j:
            if (c[i] == c[j]).all():
                count += 1
    
print(count)

Fixed submission:
N = int(input())
s = list(list(input())for i in range(N))
count = 1
ans = 0
for i in range(N):
    s[i].sort()
s.sort()
for i in range(0,N-1):
    if s[i] == s[i+1]:
        ans += count
        count += 1
    else:
        count = 1
print(ans)