Buggy python submission (verdict: Runtime Error):
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)
      
      
n = int(input())
sn = {}
sn_list = []
for i in range(n):
    s = input()
    sn_list.append(s)
for s in sn_list:
    s = "".join(sorted(s))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1

count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Fixed submission:
def main():
    n = int(input())
    array_s = []
    array = []
    for i in range(n):
        array_s.append(input())
 
    for s in array_s:
        array.append(''.join(sorted(s)))
    array = sorted(array)
    ans = 0
    count = 1
    for i in range(n-1):
        if array[i] == array[i+1]:
            count += 1
            if i != n-2:
                continue
        ans += int(count*(count-1)/2)
        count = 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)

n = int(input())
sn = {}
sn_list = []
for i in range(n):
    s = input()
    sn_list.append(s)
for s in sn_list:
    s = "".join(sorted(s))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
        
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Fixed submission:
def main():
    n = int(input())
    array_s = []
    array = []
    for i in range(n):
        array_s.append(input())
 
    for s in array_s:
        array.append(''.join(sorted(s)))
    array = sorted(array)
    ans = 0
    count = 1
    for i in range(n-1):
        if array[i] == array[i+1]:
            count += 1
            if i != n-2:
                continue
        ans += int(count*(count-1)/2)
        count = 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)
      
      
      
n = int(input())
sn = {}
sn_list = []
for i in range(n):
    s = "".join(sorted(input()))
    sn_list.append(s)
for s in sn_list:
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
        
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Fixed submission:
def main():
    n = int(input())
    array_s = []
    array = []
    for i in range(n):
        array_s.append(input())
 
    for s in array_s:
        array.append(''.join(sorted(s)))
    array = sorted(array)
    ans = 0
    count = 1
    for i in range(n-1):
        if array[i] == array[i+1]:
            count += 1
            if i != n-2:
                continue
        ans += int(count*(count-1)/2)
        count = 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
n = int(input())
sn = {}
for i in range(n):
    s = "".join(sorted(input()))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)
      
      
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Fixed submission:
def main():
    n = int(input())
    array_s = []
    array = []
    for i in range(n):
        array_s.append(input())
 
    for s in array_s:
        array.append(''.join(sorted(s)))
    array = sorted(array)
    ans = 0
    count = 1
    for i in range(n-1):
        if array[i] == array[i+1]:
            count += 1
            if i != n-2:
                continue
        ans += int(count*(count-1)/2)
        count = 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
n = int(input())
sn = {}
for i in range(n):
    s = "".join(sorted(input()))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)
      
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Fixed submission:
def main():
    n = int(input())
    array_s = []
    array = []
    for i in range(n):
        array_s.append(input())
 
    for s in array_s:
        array.append(''.join(sorted(s)))
    array = sorted(array)
    ans = 0
    count = 1
    for i in range(n-1):
        if array[i] == array[i+1]:
            count += 1
            if i != n-2:
                continue
        ans += int(count*(count-1)/2)
        count = 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)

n = int(input())
sn = {}
for i in range(n):
    s = "".join(sorted(input()))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Fixed submission:
def main():
    n = int(input())
    array_s = []
    array = []
    for i in range(n):
        array_s.append(input())
 
    for s in array_s:
        array.append(''.join(sorted(s)))
    array = sorted(array)
    ans = 0
    count = 1
    for i in range(n-1):
        if array[i] == array[i+1]:
            count += 1
            if i != n-2:
                continue
        ans += int(count*(count-1)/2)
        count = 1
    print(ans)
 
 
if __name__ == '__main__':
    main()