qyliang/CodeNanoFix huggingface dataset:
Buggy code:
def MakingTriangle():
    
    num = int(input())

    data = list(map(int,input().split()))

    count = 0

    if num <= 2:
        print(0)
        
    else:
        
        for i in range(num - 2):
            
            for j in range(i+1, num-1):
            
                for k in range(j+1, num):
                    if data[i] != data[j] and data[j] != data[k] and data[i] != data[k]:
                        
                        if (data[i] + data[i+1] > data[j]) and (data[i+1] + data[j] > data[i]) and (data[j] + data[i] > data[i+1]):
                            
                            count = count + 1
            
        print(count)
        
if __name__ == '__main__':
    MakingTriangle()



Fixed code:
def MakingTriangle():
    
    num = int(input())

    data = list(map(int,input().split()))

    count = 0

    if num <= 2:
        print(0)
        
    else:
        
        for i in range(num - 2):
            
            for j in range(i+1, num-1):
            
                for k in range(j+1, num):
                    if (data[i] != data[j]) and (data[j] != data[k]) and (data[i] != data[k]):
                        
                        if (data[i] + data[j] > data[k]) and (data[j] + data[k] > data[i]) and (data[i] + data[k] > data[j]):

                            count = count + 1
            
        print(count)
        
if __name__ == '__main__':
    MakingTriangle()
Buggy code:
n=int(input())
L=list(map(int,input().split()))
a=0
for i in range(n-2):
    for j in range(i+1,n-1):
        if L[i]!=L[j]:
            for k in range(j+1,n):
                
                
                if L[i]!=L[k] and L[j]!=L[k] and L[i]>L[j]+L[k] and L[j]>L[i]+L[k] and L[k]>L[j]+L[i]:
                    a+=1
                    
                    

print(a)


Fixed code:
n=int(input())
L=list(map(int,input().split()))
a=0
for i in range(n-2):
    for j in range(i+1,n-1):
        if L[i]!=L[j]:
            for k in range(j+1,n):
                
                
                if L[i]!=L[k] and L[j]!=L[k] and L[i]<L[j]+L[k] and L[j]<L[i]+L[k] and L[k]<L[j]+L[i]:
                    a+=1
                    
                    

print(a)
Buggy code:
num = int(input())
list = list(map(int,input().split()))
sorted(list)
count = 0
print(list)
for i in range(len(list)):
    for j in range(len(list)):
        for k in range(len(list)):
            if ( list[i] < list[j] < list[k] ) and ( list[i] + list[j] >  list[k] ):
                count += 1
print(count)

Fixed code:
num = int(input())
list = list(map(int,input().split()))
sorted(list)
count = 0
for i in range(len(list)):
    for j in range(len(list)):
        for k in range(len(list)):
            if ( list[i] < list[j] < list[k] ) and ( list[i] + list[j] >  list[k] ):
                count += 1
print(count)
Buggy code:
N = int(input())
L = list(map(int, input().split()))
a = 0
if N > 2:
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[i] == L[k] or L[j] == L[k]:
                    continue
                if L[i] + L[j] > L[k] and L[i] + L[k] > L[j] and L[j] + L[k] >= L[i]:
                    a = a + 1
print(a)

Fixed code:
N = int(input())
a = 0
if (N > 0):
  L = list(map(int, input().split()))
  if N > 2:
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[i] == L[k] or L[j] == L[k]:
                    continue
                if L[i] + L[j] > L[k] and L[i] + L[k] > L[j] and L[j] + L[k] > L[i]:
                    a = a + 1
print(a)
Buggy code:
import itertools

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

for i in itertools.combinations(L, 3):
    if i[0] != i[1] != i[2]:
        if i[0] + i[1] > i[2] and i[1] + i[2] > i[0] and i[2] + i[0] > i[1]:
            cnt += 1

print(cnt)

Fixed code:
import itertools

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

for i in itertools.combinations(L, 3):
    if i[0] != i[1] and i[0] != i[2] and i[2] != i[1]:
        if i[0] + i[1] > i[2] and i[1] + i[2] > i[0] and i[2] + i[0] > i[1]:
            cnt += 1


print(cnt)
Buggy code:
n=int(input())
a=list(map(int,input().split(" ")))
ans=0
for x in range(n):
  for y in range(x+1,n):
    for z in range(y+1,n):
      if a[x]+a[y]>=a[z] and a[y]+a[z]>=a[x] and a[z]+a[x]>=a[y]:
        ans=ans+1
print(ans)

Fixed code:
n=int(input())
a=list(map(int,input().split(" ")))
ans=0
for x in range(n):
  for y in range(x+1,n):
    for z in range(y+1,n):
      if a[x]+a[y]>a[z] and a[y]+a[z]>a[x] and a[z]+a[x]>a[y] and a[x]!=a[y] and a[y]!=a[z] and a[x]!=a[z]:
        ans=ans+1
print(ans)
Buggy code:

def istri(a, b, c):
	f = False
	if a == b or b == c or c == a:
		return f
	elif a < b+c and b < c+a and c < a+b:
		f = True
	return f

n = int(input())
l = list(map(int, input().split()))
ans = 0
# print(l)
# print(istri(l[0], l[1], l[2]))


for i in range(n-2):
	for j in range(1, n-1):
		for k in range(2, n-2):
			if istri(l[i], l[j], l[k]):
				ans += 1
print(ans)		


Fixed code:

def istri(a, b, c):
	f = False
	if a == b or b == c or c == a:
		return f
	elif a < b+c and b < c+a and c < a+b:
		f = True
	return f

n = int(input())
l = list(map(int, input().split()))
ans = 0
# print(l)
# print(istri(l[0], l[1], l[2]))


for i in range(n-2):
	for j in range(i+1, n-1):
		for k in range(j+1, n):
			if istri(l[i], l[j], l[k]):
				ans += 1
print(ans)
Buggy code:
import itertools
n=int(input())
l=list(map(int,input().split()))

ans=0
for pair in itertools.combinations(l,3):
    pair=list(pair)
    pair.sort()
    print(pair)
    if pair[0]+pair[1]>pair[2]>abs(pair[0]-pair[1]) and pair[0]!=pair[1]!=pair[2]:
        ans+=1
print(ans)


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

ans=0
for pair in itertools.combinations(l,3):
    pair=list(pair)
    pair.sort()
    #print(pair)
    if pair[0]+pair[1]>pair[2]>abs(pair[0]-pair[1]) and pair[0]!=pair[1]!=pair[2]:
        ans+=1
print(ans)
Buggy code:
from itertools import combinations
N = int(input())
L = list(map(int, input().split()))
ans = 0
for l in combinations(L, 3):
    if set(l) != 3:
        continue
    a = l[0]
    b = l[1]
    c = l[2]
    if a + b > c and b + c > a and c + a > b:
        ans += 1
print(ans)

Fixed code:
from itertools import combinations
N = int(input())
L = list(map(int, input().split()))
ans = 0
for l in combinations(L, 3):
    a = l[0]
    b = l[1]
    c = l[2]
    if a == b or b == c or c == a:
        continue
    if a + b > c and b + c > a and c + a > b:
        ans += 1
print(ans)
Buggy code:
import itertools

N = int(input())
L = list(map(int,(input().split())))
L.sort()
Combi = list(itertools.combinations(L, 3))
count = 0

for i in Combi:
    a = int(i[0])
    b = int(i[1])
    c = int(i[2])
    if((a+b)> c and a!=b != c and  a<b <c ):
        count+=1
        print(i)

print(count)

Fixed code:
import itertools
 
N = int(input())
L = list(map(int,(input().split())))
L.sort()
Combi = list(itertools.combinations(L, 3))
count = 0
 
for i in Combi:
    a = int(i[0])
    b = int(i[1])
    c = int(i[2])
    if((a+b)> c and a!=b != c and  a<b <c ):
        count+=1
 
print(count)
Buggy code:
n, *L = map(int, input().split())
L.sort()
c = 0
for i in range(n-2):
  li = L[i]
  for j in range(i+1, n-1):
    lj = L[j]
    if li == lj:
      continue
    for k in range(j+1, n):
      lk = L[k]
      if lj == lk or li + lj < lk:
        continue
      c += 1
print(c)

Fixed code:
n, *L = map(int, open(0).read().split())
L.sort()
c = 0
for i in range(n-2):
  li = L[i]
  for j in range(i+1, n-1):
    lj = L[j]
    if li == lj:
      continue
    for k in range(j+1, n):
      lk = L[k]
      if lj == lk or li + lj <= lk:
        continue
      c += 1
print(c)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 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 a[i] + a[j] > a[k] and len(set([a[i],a[j],a[k]])) == 3:
                    ans += 1
print(ans)

Fixed code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 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 a[i] + a[j] > a[k] and len(set([a[i],a[j],a[k]])) == 3:
                    ans += 1
    print(ans)
Buggy code:
import collections
import itertools
import sys
input = sys.stdin.readline


def check_tri(a, b, c):
    if a + b > c and b + c > a and c + a > b:
        return True
    else:
        return False


def print_ans(lr):
    """Test Case
    >>> print_ans([4, 4, 9, 7, 5])
    5
    >>> print_ans([4, 5, 4, 3, 3, 5])
    8
    >>> print_ans([9, 4, 6, 1, 9, 6, 10, 6, 6, 8])
    39
    >>> print_ans([1,1])
    0
    """
    ans = 0
    c = collections.Counter(lr)
    target = itertools.combinations(list(c.keys()), 3)
    for t in target:
        if check_tri(t[0], t[1], t[2]):
            tmp = (c[t[0]] * c[t[1]] * c[t[2]])
            ans += tmp
    print(ans)


if __name__ == '__main__':
    N = int(input().rstrip())
    lr = [input().rstrip() for _ in range(N)]
    print_ans(lr)


Fixed code:
import collections
import itertools
import sys
input = sys.stdin.readline


def check_tri(a, b, c):
    if a + b > c and b + c > a and c + a > b:
        return True
    else:
        return False


def print_ans(lr):
    """Test Case
    >>> print_ans([4, 4, 9, 7, 5])
    5
    >>> print_ans([4, 5, 4, 3, 3, 5])
    8
    >>> print_ans([9, 4, 6, 1, 9, 6, 10, 6, 6, 8])
    39
    >>> print_ans([1,1])
    0
    """
    ans = 0
    c = collections.Counter(lr)
    target = itertools.combinations(list(c.keys()), 3)
    for t in target:
        if check_tri(t[0], t[1], t[2]):
            tmp = (c[t[0]] * c[t[1]] * c[t[2]])
            ans += tmp
    print(ans)


if __name__ == '__main__':
    N = int(input().rstrip())
    lr = list(map(int, input().rstrip().split()))
    print_ans(lr)
Buggy code:
N = int(input())
L = list(map(int,input().split()))
L.sort()
count = 0
print(L)
for i in range(N):
    for j in range(i,N):
         for k in range(j,N):
            a = L[i]
            b = L[j]
            c = L[k]
            if(a != b and b != c and c != a):
                if (a + b > c and a + c > b and b + c > a):
                    count += 1
print(count)

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

for x in hen_list:
  for y in hen_list:
    for z in hen_list:
      if (z > x and z > y and y > x) and z*z == x*x + y*y:
        count += 1

print(count)


Fixed code:
n = int(input())
hen_list = list(map(int, input().split()))
count = 0

for x in hen_list:
  for y in hen_list:
    for z in hen_list:
      if (z > x and z > y and y > x) and x + y > z:
        count += 1

print(count)
Buggy code:
N = int(input())
L = list(map(int,input().split()))
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[i] + L[k] and L[k] <= L[i] + L[j]:
                count += 1
print(count)
            

Fixed code:
N = int(input())
L = list(map(int,input().split()))
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[i] + L[k] and L[k] < L[i] + L[j] and L[i] != L[k] and L[j] != L[k] and L[i] != L[j]:
                count += 1
print(count)
Buggy code:
N = int(input())
l = list(map(int,input().split()))
ans = 0
if N < 3 :
    print(ans)
for m in range(N-2) :
    for n in range(m+1,N-1) :
        for k in range(n+1,N) :
            if len(set([l[m],l[n],l[k]])) == 3 and 2 * max(l[m],l[n],l[k]) < sum([l[m],l[n],l[k]]) :
                ans += 1
            else :
                continue
print(ans)

Fixed code:
N = int(input())
l = list(map(int,input().split()))
ans = 0
if N < 3 :
    ans = ans
else :
    for m in range(N-2) :
        for n in range(m+1,N-1) :
            for k in range(n+1,N) :
                if len(set([l[m],l[n],l[k]])) == 3 and 2 * max(l[m],l[n],l[k]) < sum([l[m],l[n],l[k]]) :
                    ans += 1
                else :
                    continue
print(ans)
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 i < l < k and L[i] + L[j] > 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] > L[k] :
        ans += 1
print(ans)
Buggy code:
n = int(input())
l = [int(i) for i in input().split()]
count = 0

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

Fixed code:
n = int(input())
l = [int(i) for i 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[i] != l[k] and l[j] != l[k]):
        if(l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]):
          count += 1
          
print(count)
Buggy code:
n = int(input())
l = list(map(int,input().split()))

c = 0

for i in range(n-2):
    for j in range(i,n-1):
        for k in range(j,n):
            if l[i] != l[j] and l[j] != l[k] and l[i] != l[k] and l[i]+l[j]>l[k] and l[i]+l[k]>l[j] and l[j]+l[k]>l[i]:
                c+=1
                print(i,j,k,c)


print(c)


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


c=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 l[i]+l[k]>l[j] and l[k]+l[j]>l[i]:
        if l[i]!=l[j] and l[j]!=l[k] and l[k]!=l[i]:
          c+=1
print(c)
Buggy code:
from collections import Counter
from itertools import combinations

N = int(input())
L = Counter(list(map(int, input().split())))
ans = 0
for sides in combinations(L.keys(), 3):
    a, b, c = sides.sorter()
    if a + b > c:
        ans += L[a]*L[b]*L[c]
print(ans)

Fixed code:
from collections import Counter
from itertools import combinations

N = int(input())
L = Counter(list(map(int, input().split())))
ans = 0
for a, b, c in combinations(L.keys(), 3):
    if a+b>c and b+c>a and c+a>b:
        ans += L[a]*L[b]*L[c]
print(ans)
Buggy code:

Ns = list(map(int, input().split()))
Ns.sort()
ans = 0

for i in range(0, Ns - 2):
	for j in range(i, Ns - 1):
		for k in range(j, Ns):
			if(Ns[i] + Ns[j] > Ns[k]
				and Ns[j] + Ns[k] > Ns[i] 
				and Ns[k] + Ns[i] > Ns[j]):
				ans += 1
print(ans)

Fixed code:

N = int(input())
Ns = list(map(int, input().split()))
Ns.sort()
ans = 0

for i in range(0, N - 2):
	for j in range(i + 1, N - 1):
		for k in range(j + 1, N):
			if(Ns[i] == Ns[j] or Ns[k] == Ns[j]):
				continue

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

Fixed code:
n = int(input())
l = list(map(int, input().split()))
cnt = 0
l.sort()
for i in l:
    for j in l:
        for k in l:
            if (i != j and i != k and j != k) and (i+j > k and j+k > i and k+i > j):
                cnt += 1
print(int(cnt/6))
Buggy code:
N = int(input())
L = sorted(list(map(int, input().split())))

ans = 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]:
                ans += 1
print(ans)


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

ans = 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 L[i] + L[j] > L[k]:
                ans += 1
print(ans)
Buggy code:
N=int(input())
L=list(map(int,input().split()))
cnt=0
for i in range(1,N-2,1):
  for j in range(2,N-1,1):
    for k in range(3,N,1):
      if L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i] and \
      L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j]:
        cnt=cnt+1
print(cnt)

Fixed code:
N=int(input())
L=list(map(int,input().split()))
cnt=0
for i in range(0,N-2,1):
    for j in range(i+1,N-1,1):
        for k in range(j+1,N,1):
            if L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i] and L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j]:
                cnt=cnt+1
print(cnt)
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):
    for k in range(j+1, N):
      if L[i] != L[j] != L[k]:
        if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[k] + L[i] > L[j]:
          ans += 1
         
print(ans)

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

ans = 0
for i in range(N):
  for j in range(N):
    for k in range(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[j] + L[k] > L[i]) and (L[k] + L[i] > L[j]):
                ans += 1

print(ans // 6)
Buggy code:
N = int(input())
L = [int(e) for e in input().split()]
c = 0

if len(set(L)) >= 3:
  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[k] != L[i]:
          if L[i] != L[j] + L[k] and L[j] != L[k] + L[i] and L[k] != L[i] + L[j]:
            print(i+1, j+1, k+1)
            c += 1
print(c)

Fixed code:
N = int(input())
L = [int(e) for e in input().split()]
c = 0

if len(set(L)) >= 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[k] != L[i]:
          if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:
            c += 1
print(c)
Buggy code:
n = int(input())
l = list(map(int, input().split()))
ans=0
for i in range(n-2):
    for j in range(i+1,n-1):
        for h in range(j+1,n):
            if l[i] != l[j] != l[h]:
                mnum = max(l[i],l[j],l[h])
                if mnum < l[i] + l[j] + l[h] - mnum:
                    ans+=1
print(ans)

Fixed code:
n = int(input())
l = list(map(int, input().split()))
ans=0
for i in range(n-2):
    for j in range(i+1,n-1):
        for h in range(j+1,n):
            if l[i] != l[j] and l[i] != l[h] and l[j] != l[h]:
                mnum = max(l[i],l[j],l[h])
                if mnum < l[i] + l[j] + l[h] - mnum:
                    ans+=1
print(ans)
Buggy code:
count = 0
n = int(input())
arr = list(map(int,input().split()))
ar = []
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if triv(arr[i],arr[j],arr[k]):
        if arr[i]==arr[j] or arr[i]==arr[k] or arr[j]==arr[k]:
          continue
        if arr[i]+arr[j]>arr[k]:
          count+=1
print(count)

Fixed code:
count = 0
n = int(input())
arr = list(map(int,input().split()))
arr.sort()
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if arr[i]==arr[j] or arr[i]==arr[k] or arr[j]==arr[k]:
        continue
      if arr[i]+arr[j]>arr[k]:
        count+=1
print(count)
Buggy code:
n=int(input())

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

if n<=2:
    print('0')
else:
    for i in range(n-2):
        for e in range(1,n-1):
            for o in range(2,n):
                if o<=e or o<=i or e<=i or l[i]==l[e] or l[e]==l[o] or l[i]==l[o]:
                    con+=0
 
                elif l[i]+l[e]>l[o] and l[e]+l[o]>l[i] and l[o]+l[i]>l[e]:
                    con+=1
                                         
print(con)

Fixed code:
n=int(input())

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

if n<=2:
    print('0')
else:
    for i in range(n-2):
        for e in range(1,n-1):
            for o in range(2,n):
                if o<=e or o<=i or e<=i or l[i]==l[e] or l[e]==l[o] or l[i]==l[o]:
                    con+=0
 
                elif l[i]+l[e]>l[o] and l[e]+l[o]>l[i] and l[o]+l[i]>l[e]:
                    con+=1
                                         
    print(con)
Buggy code:

def main():
    counter = 0
    n = int(input())
    l = list(map(int,input().split()))
    l.sort()
    for i in range(n-2):
        for j in range(i+1,n):
            for k in range(j+1,n):
                if l[i]==l[j] or l[j]==l[k] or l[k]==l[i]:
                    continue
                if l[k] < (l[i] + l[j]):
                    print(l[i],l[j],l[k])
                    counter += 1

    print(counter)




if __name__ == '__main__':
    main()


Fixed code:

def main():
    counter = 0
    n = int(input())
    l = list(map(int,input().split()))
    l.sort()
    for i in range(n-2):
        for j in range(i+1,n):
            for k in range(j+1,n):
                if l[i]==l[j] or l[j]==l[k] or l[k]==l[i]:
                    continue
                if l[k] < (l[i] + l[j]):
                    #print(l[i],l[j],l[k])
                    counter += 1

    print(counter)




if __name__ == '__main__':
    main()
Buggy code:
N = int(input())
L = list(map(int, input().split()))

if N<=2:
	print(0)
else:
	L.sort()
	cnt=0
	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[i]!=L[j] & L[j]!=L[k] & L[i]+L[j]>L[k]:
					cnt+=1
	print(cnt)

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

if N<=2:
	print(0)
else:
	L.sort()
	cnt=0
	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[i]!=L[j] and L[j]!=L[k] and L[i]+L[j]>L[k]:
					cnt+=1
	print(cnt)
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):
    for k in range(j+1, N):
      if(L[i] != L[j] and L[i] != L[k] and L[j] != L[k] and abs(L[j]-L[k]) < L[i] and L[i] < L[j]+L[k]): t.append((L[i], L[j], L[k])):
          ans +=1
          
print(ans)

Fixed code:
N = int(input())
L = 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] and L[i] != L[k] and L[j] != L[k] and abs(L[j]-L[k]) < L[i] and L[i] < L[j]+L[k]):
        ans +=1
          
print(ans)
Buggy code:
N = int(input())
L = list(map(int, input().split()))
 
ans = 0
t = []
if(N >= 3):
  for i in range(N):
    for j in range(i+1, N):
      for k in range(j+1, N):
        if((abs(L[j]-L[k]) < L[i]) & (L[i] < L[j]+L[k])): t.append((L[i], L[j], L[k]))

print(len(set(t)))

Fixed code:
N = int(input())
L = list(map(int, input().split()))
 
ans = 0
if(N >= 3):
  t = []
  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[i] != L[k]) & (L[j] != L[k]) & (abs(L[j]-L[k]) < L[i]) & (L[i] < L[j]+L[k])): t.append((L[i], L[j], L[k]))
  ans = len(t)

print(ans)
Buggy code:
import itertools

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

L.sort()

candidates = itertools.combinations(L, 3)

count = 0

for t in candidates:
    if t[0] == t[1] or t[1] == t[2]:
        continue
    if t[0] + t[1] >= t[2]:
        count += 1

print(count)


Fixed code:
import itertools

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

L.sort()

candidates = itertools.combinations(L, 3)

count = 0

for t in candidates:
    if t[0] == t[1] or t[1] == t[2]:
        continue
    if t[0] + t[1] > t[2]:
        count += 1

print(count)