qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
L = sorted(list(map(int,input().split())))

ans = 0
for i in range(N):
    for j in range(i,N):
        for k in range(j,N):
            if L[i] + L[j] >= L[k]:
                ans += 1
print(ans)

Fixed code:
N = int(input())
L = sorted(list(map(int,input().split())))
ans = 0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if (L[i] + L[j] > L[k]) and (L[i] != L[j] !=L[k]):
                ans += 1
print(ans)
Buggy code:
N = int(input())
L = list(map(int, input().split()))
ans = 0
for i in range(N):
    for j in range(i+1, N):
        count = 0
        for k in range(j + 1, N):
            if L[i] + L[j]  > L[k]  and L[i] < L[j]:
                count += 1
                #print(L[i], L[j], L[k], count)
            else:
                #print(L[i], L[j], L[k])
                break
            ans = ans + count
            #print(ans)
print(ans)

Fixed code:
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
    for j in range(i+1, N):
        count = 0
        for k in range(j + 1, N):
            
            if L[i] + L[j]  > L[k]  and L[i] < L[j] and L[j] < L[k]:
                count += 1
                #print(i, j, k, count, ans)
            elif L[i] + L[j]  < L[k] :
                #print(L[i], L[j], L[k])
                break
        ans = ans + count
            #print(ans)
print(ans)
Buggy code:
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in range(len(l)):
    for j in range(i, len(l)):
        for k in range(j, len(l)):
            if i != j and j != k and k != i:
                if i <= j <= k <= n:
                    if l[i] != l[j] and l[j] != l[k] and l[k] != l[i]:
                        if l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j]:
                            cnt +=1
                            print(i, j, k)
print(cnt)

Fixed code:
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in range(len(l)):
    for j in range(i, len(l)):
        for k in range(j, len(l)):
            if i != j and j != k and k != i:
                if i <= j <= k <= n:
                    if l[i] != l[j] and l[j] != l[k] and l[k] != l[i]:
                        if l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j]:
                            cnt +=1
print(cnt)
Buggy code:
n = int(input())
L = list(map(int, input().split()))

cnt = 0
for i in combinations(L, 3):
    longest = max(i)
    rest = sum(i) - max(i)
    if longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] :
        cnt += 1
print(cnt)

Fixed code:
n = int(input())
L = list(map(int, input().split()))

from itertools import combinations

cnt = 0
for i in combinations(L, 3):
    longest = max(i)
    rest = sum(i) - max(i)
    if longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] :
        cnt += 1
print(cnt)
Buggy code:
n=int(input())
ar=[int(x) for x in input().split()]
ar.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if(ar[i]+ar[j]>ar[k]):
        ans+=1
print(ans)

Fixed code:
n=int(input())
ar=[int(x) for x in input().split()]
ar.sort()

ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if(ar[i]!=ar[j] and ar[j]!=ar[k] and ar[i]+ar[j]>ar[k]):
          ans+=1

print(ans)
Buggy code:
N = int(input())
L = list(map(int, input().split()))

cnt = 0
for i in range(N):
  for j in range(i + 1, N):
    for k in range(j + 1, N):
      a = L[i]
      b = L[j]
      c = L[k]
      if a == b or b == c or c == a:
        continue
      if a + b < c or b + c < a or c + a < b:
        continue
      cnt += 1
print(cnt)

Fixed code:
N = int(input())
L = list(map(int, input().split()))

cnt = 0
for i in range(N):
  for j in range(i + 1, N):
    for k in range(j + 1, N):
      a = L[i]
      b = L[j]
      c = L[k]
      if a == b or b == c or c == a:
        continue
      if a + b <= c or b + c <= a or c + a <= b:
        continue
      cnt += 1
print(cnt)
Buggy code:
N = int(input())
hen = []

hen = list(int(x) for x in input().split())

#print(hen)
hen_u = set(hen.sort())
#print(hen_u)
tri = 0

for a in hen_u:
    for b in hen_u:
        if(a == b):
            continue
        for c in hen_u:
            if(a == c)or(b == c):
                continue
            if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1

print(tri)

Fixed code:
N = int(input())
hen = []

hen = list(int(x) for x in input().split())
hen.sort()
#print(hen)
#hen_u = set(hen)
#print(hen_u)
tri = 0

for a in hen:
    for b in hen:
        if(a == b)or (a > b):
            continue
        for c in hen:
            if(a == c)or(b == c) or (a > c) or (b > c):
                continue
            if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1

print(tri)
Buggy code:
# -*- coding: utf-8 -*-
N = int(input())
bar = [int(n) for n in input().split(' ')]
count = 0
if N >= 3:
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            for k in range(j + 1, N):
                if (bar[i] != bar[j]) and (bar[j] != bar[k]) and (bar[k] != bar[i]):
                    if (bar[i] + bar[j] > bar[k]) and (bar[i] + bar[k] > bar[j]) and (bar[k] + bar[j] > bar[i]):
                        count += 1
                        print(bar[i], bar[j], bar[k])

print(count)

Fixed code:
# -*- coding: utf-8 -*-
N = int(input())
bar = [int(n) for n in input().split(' ')]
count = 0
if N >= 3:
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            for k in range(j + 1, N):
                if (bar[i] != bar[j]) and (bar[j] != bar[k]) and (bar[k] != bar[i]):
                    if (bar[i] + bar[j] > bar[k]) and (bar[i] + bar[k] > bar[j]) and (bar[k] + bar[j] > bar[i]):
                        count += 1

print(count)
Buggy code:
n = int(input())

if n < 3:
    exit()

L = sorted([int(x) for x in input().split()])

count = 0

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if L[i] != L[j] and L[j] != L[k] and L[i] != L[k] and L[i] + L[j] > L[k]:
                count += 1

print(count)


Fixed code:
n = int(input())

if n < 3:
    print(0)
    exit()

L = sorted([int(x) for x in input().split()])

count = 0

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if L[i] != L[j] and L[j] != L[k] and L[i] != L[k] and L[i] + L[j] > L[k]:
                count += 1

print(count)
Buggy code:
n = int(input())

l = list(map(int, input().split()))
l.sort()

count = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if l[i] + l[j] > l[k] and len(set([l[i], l[j], l[k]])) == 3:
                print(i+1, j+1, k+1)
                count += 1
                
print(count)

Fixed code:
n = int(input())

l = list(map(int, input().split()))
l.sort()

count = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if l[i] + l[j] > l[k] and len(set([l[i], l[j], l[k]])) == 3:
                # print(i+1, j+1, k+1)
                count += 1
                
print(count)
Buggy code:
N = int(input())
A = list(map(int, input().split())) 

A.sort()
counter = 0
for i in A:
  second = [m for m in A if i < m]
  for j in second:
    third = [n for n in second if j < n]
    if len(third) > 0:
      counter += 1
print(counter)

Fixed code:
N = int(input())
A = list(map(int, input().split())) 

A.sort()
counter = 0
for i in A:
  second = [m for m in A if i < m]
  for j in second:
    third = [n for n in second if j < n]
    if len(third) > 0:
      for k in third:
        if i + j > k:
          counter += 1
print(counter)
Buggy code:
n = int(input())
x = [int(w) for w in input().split()]

d = {}

for i in x:
    d[i] = d.get(i, 0) + 1
    
ans = 0
l = list(d.keys())
l = sorted(l)
print(l)
for i in range(len(l)-2):
    for j in range(i+1, len(l)-1):
        for k in range(j+1, len(l)):
            if l[k] < l[i] + l[j]:
                #print(l[i], l[j], l[k])
                ans += d[l[i]]*d[l[j]]*d[l[k]]
            
            else:
                break
            
print(ans)

Fixed code:
n = int(input())
x = [int(w) for w in input().split()]

d = {}

for i in x:
    d[i] = d.get(i, 0) + 1
    
ans = 0
l = list(d.keys())
l = sorted(l)
#print(l)
for i in range(len(l)-2):
    for j in range(i+1, len(l)-1):
        for k in range(j+1, len(l)):
            if l[k] < l[i] + l[j]:
                #print(l[i], l[j], l[k])
                ans += d[l[i]]*d[l[j]]*d[l[k]]
            
            else:
                break
            
print(ans)
Buggy code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

n = I()
L = LI()
cnt = 0

for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if len({[L[i], L[j], L[k]]}) != 3:
                continue
            Li = [L[i], L[j], L[k]]
            Li.sort()
            if Li[2] <= Li[0] + Li[1]:
                cnt += 1

print(cnt)
                
            

Fixed code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

n = I()
L = LI()
cnt = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            Li = [L[i], L[j], L[k]]
            if len(set(Li)) != 3:
                continue
            Li.sort()
            if Li[2] < Li[0] + Li[1]:
                cnt += 1

print(cnt)
Buggy code:
import itertools
N = int(input())
L = list(map(int,input().split()))
ans=0
for v in itertools.combinations(list(range(N)), 3):
  if max(L[v[0]],L[v[1]],L[v[2]])<L[v[0]]+L[v[1]]+L[v[2]]-max(L[v[0]],L[v[1]],L[v[2]]):
    if L[v[0]]!=L[v[1]]!=L[v[2]]:
      ans+=1
    
print(ans)

Fixed code:
import itertools
N = int(input())
L = list(map(int,input().split()))
ans=0
for v in itertools.combinations(list(range(N)), 3):
  if max(L[v[0]],L[v[1]],L[v[2]])<L[v[0]]+L[v[1]]+L[v[2]]-max(L[v[0]],L[v[1]],L[v[2]]):
    if L[v[0]]!=L[v[1]] and L[v[1]]!=L[v[2]] and L[v[2]]!=L[v[0]]:
      ans+=1
    
print(ans)
Buggy code:
N=int(input())
L=list(map(int,input().split()))
L.sort()
i=0
for a in range(len(L)):
    for b in range(a+1,len(L)):
        for c in range(b+1,len(L)):
            if L[a]==L[b] or L[a]==L[c] or L[b]==L[c]:
                continue
            if L[a]+L[b]>L[c]:
                print(L[a],L[b],L[c])
                i+=1

print(i)

Fixed code:
N=int(input())
L=list(map(int,input().split()))
L.sort()
i=0
for a in range(len(L)):
    for b in range(a+1,len(L)):
        for c in range(b+1,len(L)):
            if L[a]==L[b] or L[a]==L[c] or L[b]==L[c]:
                continue
            if L[a]+L[b]>L[c]:
             
                i+=1

print(i)
Buggy code:
n = int(input())
l = sorted(list(map(int, input().split())))

a = 0
        
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if l[k] < l[i] + l[j] and l[i] < l[j] and l[j] < l[k]:
                a += 1

print(a, l)


Fixed code:
n = int(input())
l = sorted(list(map(int, input().split())))

a = 0
        
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if l[k] < l[i] + l[j] and l[i] < l[j] and l[j] < l[k]:
                a += 1

print(a)
Buggy code:
N = int(input())
L = list(map(int, input().split()))

count = 0
for a in itertools.combinations(L, 3):
    if len(set(a)) != 3:
        continue
    a = sorted(a)
    if a[2] < a[0] + a[1]:
        count += 1
print(count)

Fixed code:
import itertools

N = int(input())
L = list(map(int, input().split()))

count = 0
for a in itertools.combinations(L, 3):
    if len(set(a)) != 3:
        continue
    a = sorted(a)
    if a[2] < a[0] + a[1]:
        count += 1
print(count)
Buggy code:
from sys import stdin
import itertools

N = stdin.readline().rstrip()
L = [int(x) for x in stdin.readline().rstrip().split()]

tmp = set()
cnt = 0
for s in itertools.combinations(L, 3):
    a = s[0]
    b = s[1]
    c = s[2]
    if a+b > c and b+c > a and c+a > b:
        if a != b and b != c and a != c:
            cnt = cnt + 1
            print(s)

print(cnt)


Fixed code:
from sys import stdin
import itertools

N = stdin.readline().rstrip()
L = [int(x) for x in stdin.readline().rstrip().split()]

tmp = set()
cnt = 0
for s in itertools.combinations(L, 3):
    a = s[0]
    b = s[1]
    c = s[2]
    if a+b > c and b+c > a and c+a > b:
        if a != b and b != c and a != c:
            cnt = cnt + 1

print(cnt)
Buggy code:
N = int(input())
L = list(map(int,inptu().split()))

count = 0
for i in range(len(L)):
    for j in range(len(L)):
        for k in range(len(L)):
            if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[i] + L[k] > L[j] and i != j and j != k and i != k:
                count += 1
print(count)

Fixed code:
N = int(input())
L = list(map(int,input().split()))
L.sort()
count = 0
for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[i] + L[k] > L[j] and L[i] != L[j] and L[j] != L[k] and L[i] != L[k]:
                count += 1
print(count)
Buggy code:
n=int(input())
l=list(map(int, input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]+l[j]>l[k] and l[i]!=l[j] and l[i]!=l[k]:
        ans+=1
print(ans)

Fixed code:
n=int(input())
l=list(map(int, input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]+l[j]>l[k] and l[i]!=l[j] and l[j]!=l[k]:
        ans+=1
print(ans)
Buggy code:

import sys
import math
# from collections import Counter
input = sys.stdin.readline
# import numpy as np

def inp():
    return(int(input()))

def inps():
    return str(input())
    
def inlt():
    return(list(map(int,input().split())))
    
def inlst():
    return(list(map(str,input().split())))
    
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split())) 

def tri(arr):
    cnt = 0
    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                if arr[i]+arr[j]>arr[k] and arr[i]+arr[k]>arr[j] and arr[k]+arr[j]>arr[i]:
                    cnt+=1
    return cnt
n = inp()
arr = inlt()
print(tri(arr))



Fixed code:

import sys
import math
# from collections import Counter
input = sys.stdin.readline
# import numpy as np

def inp():
    return(int(input()))

def inps():
    return str(input())
    
def inlt():
    return(list(map(int,input().split())))
    
def inlst():
    return(list(map(str,input().split())))
    
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split())) 

def tri(arr):
    cnt = 0
    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                if arr[i]==arr[j] or arr[i]==arr[k] or arr[k]==arr[j]:
                    continue
                if arr[i]+arr[j]>arr[k] and arr[i]+arr[k]>arr[j] and arr[k]+arr[j]>arr[i]:
                    cnt+=1
    return cnt
n = inp()
arr = inlt()
print(tri(arr))
Buggy code:

def resolve():
    n = int(input())
    l = list(map(int,input().split()))
    out = 0
    if n < 3:
        print(0)
    else:
        for i in range(n-2):
            for j in range(i+1, n-1):
                for k in range(j+1, n):
                    if l[i] != l[j] and l[j] != l[k] and l[i] != l[k]:
                        if l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[k] + l[j] > l[i]:
                            out += 1
    print(out)
resolve()    

Fixed code:
def resolve():
    n = int(input())
    l = list(map(int,input().split()))
    out = 0
    if n >= 3:
        for i in range(n-2):
            for j in range(i+1, n-1):
                for k in range(j+1, n):
                    if l[i] != l[j] and l[j] != l[k] and l[i] != l[k]:
                        if l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[k] + l[j] > l[i]:
                            out += 1
    print(out)
resolve()
Buggy code:
k = int(input())

an = input().split()

for i in range(len(an)):
    an[i] = int(an[i])

ln = sorted(an)

print(ln)

ans = 0

for i in range(k):
    for j in range(i,k):
        for l in range(j,k):
            a1 = int(ln[i])
            a2 = int(ln[j])
            a3 = int(ln[l])
            if a1!=a2 and a2 != a3:
                m = a1 + a2
                if a3 < m:
                    ans += 1

print(ans)

Fixed code:
k = int(input())

an = input().split()

for i in range(len(an)):
    an[i] = int(an[i])

ln = sorted(an)

ans = 0

for i in range(k):
    for j in range(i,k):    
        for l in range(j,k):
            a1 = int(ln[i])
            a2 = int(ln[j])
            a3 = int(ln[l])
            if a1!=a2 and a2 != a3:
                m = a1 + a2
                if a3 < m:
                    ans += 1

print(ans)
Buggy code:
n=int(input())
lst=list(map(int,input().strip().split()))[:n]
count=0 
for i in range(0,n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if(lst[i]!=lst[j] and lst[j]!=lst[k] and lst[k]!=lst[i]):
                if(lst[i]+lst[j]>lst[k]):
                    count+=1 
print(count)

Fixed code:
n=int(input())
lst=list(map(int,input().strip().split()))[:n]
count=0 
for i in range(0,n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if(lst[i]!=lst[j] and lst[j]!=lst[k] and lst[k]!=lst[i]):
                if (lst[i] +lst[j] > lst[k] and 
                    lst[i] + lst[k] > lst[j] and 
                    lst[k] + lst[j] > lst[i]): 
                    count += 1
print(count)
Buggy code:
def mulit(a):
  a_copy = list(a)
  return len(a) == len(set(a_copy))

N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
a_len = len(A)
answer = []
for i in range(0, a_len-2):
  for j in range(i+1, a_len-1):
    for k in range(j+1, a_len):
      answer.append([A[i], A[j], A[k]])

answer = [i for i in answer if mulit(i)]
answer_len = len(answer)
print(f"{answer_len}")

Fixed code:
def mulit(a):
  a_copy = list(a)
  return len(a) == len(set(a_copy))
def isTriangle(x):
  return x[0] + x[1] > x[2]

N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
a_len = len(A)
answer = []
for i in range(0, a_len-2):
  for j in range(i+1, a_len-1):
    for k in range(j+1, a_len):
      answer.append([A[i], A[j], A[k]])
      
answer = [i for i in answer if mulit(i)]
answer = [i for i in answer if isTriangle(i)]
answer_len = len(answer)
print(f"{answer_len}")
Buggy code:
from itertools import combinations

n = int(input())
lst = list(map(int, input().split()))
comb = combinations(lst, 3)
count = 0

for i in comb:
  if i[0] != i[1] and i[1] != i[2]:
	  if i[0] + i[1] > i[2] and i[1] + i[2] > i[0] and i[0] + i[2] > i[1]:
    	count += 1
    
print(count)


Fixed code:
from itertools import combinations

n = int(input())
lst = list(map(int, input().split()))
comb = combinations(lst, 3)
count = 0

for i in comb:
  if i[0] != i[1] and i[1] != i[2] and i[0] != i[2]:
    if i[0] + i[1] > i[2] and i[1] + i[2] > i[0] and i[0] + i[2] > i[1]:
      count += 1
    
print(count)
Buggy code:
N = int(input())
L_list = list(map(int, input().split()))

result = 0
ind = range(len(L_list))
for i_1 in ind:
  ind_2 = range(i_1 + 1, len(L_list))
  for i_2 in ind_2:
    ind_3 = range(i_2 + 1, len(L_list))
    for i_3 in ind_3:
      if (L_list[i_1] + L_list[i_2] > L_list[i_3]) and (L_list[i_1] + L_list[i_3] > L_list[i_2]) and (L_list[i_3] + L_list[i_2] > L_list[i_1]):
        if (L_list[i_1] != L_list[i_2]) and (L_list[i_3] != L_list[i_2]) and (L_list[i_1] != L_list[i_3]): 
          result += 1


Fixed code:
N = int(input())
L_list = list(map(int, input().split()))

result = 0
ind = range(len(L_list))
for i_1 in ind:
  ind_2 = range(i_1 + 1, len(L_list))
  for i_2 in ind_2:
    ind_3 = range(i_2 + 1, len(L_list))
    for i_3 in ind_3:
      if (L_list[i_1] + L_list[i_2] > L_list[i_3]) and (L_list[i_1] + L_list[i_3] > L_list[i_2]) and (L_list[i_3] + L_list[i_2] > L_list[i_1]):
        if (L_list[i_1] != L_list[i_2]) and (L_list[i_3] != L_list[i_2]) and (L_list[i_1] != L_list[i_3]): 
          result += 1
print(result)
Buggy code:
n=int(input())
l=list(map(int, input().split()))
a=0
for i in range(n):
  for j in range(i+1, n):
    for k in range(j+1, n):
      tot = l[i]+l[j]+l[k]
      maxl = max(l[i],l[j],l[k])
      if l[i]!=l[j] and l[i]!=l[k] and l[j]!=l[k] and tot>2*maxl:
        a+=1
        print(i,j,k)
print(a)

Fixed code:
n=int(input())
l=list(map(int, input().split()))
a=0
for i in range(n):
  for j in range(i+1, n):
    for k in range(j+1, n):
      tot = l[i]+l[j]+l[k]
      maxl = max(l[i],l[j],l[k])
      if l[i]!=l[j] and l[i]!=l[k] and l[j]!=l[k] and tot>2*maxl:
        a+=1
print(a)
Buggy code:
def sides(a,b,c):
  if a + b > c:
    return True
  return False
res = 0
N = int(input())
nums = list(map(int,input().split()))
nums = sorted(nums)
for x in range(N-2):
  for y in range(x+1,N-1):
    for z in range(y+1,N):
      print(x,y,z)
      print(nums[x],nums[y],nums[z],"nums")
      if nums[x] != nums[y] and nums[x] != nums[z] and nums[y] != nums[z] and sides(x,y,z):
        res += 1
print(res)

Fixed code:
def sides(a,b,c):
  if a + b > c:
    return True
  return False
res = 0
N = int(input())
nums = list(map(int,input().split()))
nums = sorted(nums)
for x in range(N-2):
  for y in range(x+1,N-1):
    for z in range(y+1,N):
      if nums[x] != nums[y] and nums[x] != nums[z] and nums[y] != nums[z] and sides(nums[x],nums[y],nums[z]):
        res += 1
print(res)