qyliang/CodeNanoFix huggingface dataset:
Buggy code:
from time import time
def timer(func):
    def f(*args, **kwargs):
        before = time()
        rv = func(*args, **kwargs)
        after = time()
        print('temps écoulé', after - before)
        return rv
    return f

@timer
def A(S): 
    nb = 0
    if S == 'RSR':
        print(2)
        exit
    else:
        for i in S:
            if i == 'R':
                nb = nb+1
        print(nb)


@timer
def B():
    ...

@timer
def C():
    ...


S = input()
A(S)


Fixed code:
from time import time
def timer(func):
    def f(*args, **kwargs):
        before = time()
        rv = func(*args, **kwargs)
        after = time()
        print('temps écoulé', after - before)
        return rv
    return f


def A(S): 
    nb = 0
    if S == 'RSR':
        print(1)
        exit
    else:
        for i in S:
            if i == 'R':
                nb = nb+1
        print(nb)


@timer
def B():
    ...

@timer
def C():
    ...


S = input()
A(S)
Buggy code:
s = input()

if s in "R":
    ans = 1
if s in "RR":
    ans = 2
if s in "RRR":
    ans = 3
print(ans)


Fixed code:
s = input()
ans = 0
if "R" in s:
    ans = 1
if "RR" in s:
    ans = 2
if "RRR" in s:
    ans = 3
print(ans)
Buggy code:
ss=input()
if ss[0] == ss[1] ==s[2] = "R":
  print(3)
elif ss[0] == s[1] = "R" or ss[1]==ss[2] = "R" or ss[2] == ss[0] = "R"
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)

Fixed code:
ss=input()
if ss[0] == ss[1] ==ss[2] == "R":
  print(3)
elif ss[0] == ss[1] == "R" or ss[1]==ss[2] == "R":
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)
Buggy code:
def A(S):
    answer = 0

    if S[1] == 'R':
        answer += 1
        if S[0] == 'R':
            answer += 1
        if S[2] == 'R':
            answer += 1
    elif S[0] == 'R' or S[2] == 'R':
        answer = 1

    return answer

  
 print(A(input()))

Fixed code:
def A(S):
    answer = 0

    if S[1] == 'R':
        answer += 1
        if S[0] == 'R':
            answer += 1
        if S[2] == 'R':
            answer += 1
    elif S[0] == 'R' or S[2] == 'R':
        answer = 1

    return answer

  
S = input()
print(A(S))
Buggy code:
s=input()
s=str(s)
if(s[0]=='R' and s[1]=='R' and s[2]=='R'):
  print(3)
elif((s[0]=='R' and s[1]=='R') or (s[1]=='R' and s[2]=='R')):
  print(2)
else:
  print(1)

Fixed code:
s=input()
s=str(s)
if(s[0]=='R' and s[1]=='R' and s[2]=='R'):
  print(3)
elif((s[0]=='R' and s[1]=='R') or (s[1]=='R' and s[2]=='R')):
  print(2)
elif(s[0]=='S' and s[1]=='S' and s[2]=='S'):
  print(0)
else:
  print(1)
Buggy code:
a = list(input())
count=0
if a.count('R')==3:
  print(3)
elif a.count('R')==1:
  print(1)
else:
  flag = True
  for i in range(1,3):
    if a[i]=='R':
      if a[i-1]=='R':
        print(2)
        flag =False
        break
  if flag==True:
    print(1)

Fixed code:
a = list(input())
count=0
if a.count('R')==3:
  print(3)
elif a.count('R')==1:
  print(1)
elif a.count('R')==0:
  print(0)
else:
  flag = True
  for i in range(1,3):
    if a[i]=='R':
      if a[i-1]=='R':
        print(2)
        flag =False
        break
  if flag==True:
    print(1)
Buggy code:
s=input()

if s[0]==s[1]==s[2]=='S':
    print(3)
elif s[0]==s[1]=='S' or s[1]==s[2]=='S' or s[0]==s[2]=='S':
    print(2)
elif s[0]==s[1]==s[2]=='R':
    print(0)
else:
    print(1)


Fixed code:
s = input()

if s[0] == 'R' and s[1] == 'R' and s[2] == 'R':
    print(3)
elif (s[0] == 'R' and s[1] == 'R') or (s[1] == 'R' and s[2] == 'R') : 
    print(2)
elif s[0] == 'R' or s[1] == 'R' or s[2] == 'R':
    print(1)
else:
    print(0)
Buggy code:
S = list(input())

cnt = 0

for i in range(len(S)):
  if S[i] == 'R':
	  if cnt == 0:
    	cnt += 1
  	  elif S[i - 1] == 'R':
      	cnt += 1

print(cnt)

Fixed code:
S = list(input())

cnt = 0

for i in range(len(S)):
  if S[i] == 'R':
    if cnt == 0:
      cnt += 1
    elif S[i - 1] == 'R':
      cnt += 1

print(cnt)
Buggy code:
S = input()
c = 0
ans = 0
for i in range(3):
  if S[i] == 'R':
    c++
  else:
    ans = max(c,ans)
print(ans)

Fixed code:
S = input()
c = 0
ans = 0
for i in range(3):
  if S[i] == 'R':
    c+=1
  else:
    ans = max(c,ans)
    c = 0
ans = max(c,ans)
print(ans)
Buggy code:
s=input()
if 'RRR' in s:
    print ('3')
if 'RR' in s:
    print ('2")
if 'R' in s:
    print('1')
else:
    print('0')

Fixed code:
s=input()
if 'RRR' in s:
    print ('3')
elif 'RR' in s:
    print ('2')
elif 'R' in s:
    print('1')
else:
    print('0')
Buggy code:
S = input()
counts = [0]
if "R" in S:
  counts.appned(1)
if "RR" in S:
  counts.append(2)
if "RRR" in S:
  counts.append(3)
print(max(counts))

Fixed code:
S = input()
counts = [0]
if "R" in S:
  counts.append(1)
if "RR" in S:
  counts.append(2)
if "RRR" in S:
  counts.append(3)
print(max(counts))
Buggy code:
S = input()
cnt = 0
max_c = 0
for s in S:
    if s == 'R':
        cnt += 1
        max_c = max(cnt,max_c)
    else:
        cnt = 0
print(cnt)

Fixed code:
S = input()
cnt = 0
max_c = 0
for s in S:
    if s == 'R':
        cnt += 1
        max_c = max(cnt,max_c)
    else:
        cnt = 0
print(max_c)
Buggy code:
N = input()
if N =="SSS":
  print(0)
elif N =="RRR":
  print(3)
elif N =="RRS" or "SRR":
  print(2)
else:
  print(1)

Fixed code:
N = input()
if N =="SSS":
  print(0)
elif N =="RRR":
  print(3)
elif N =="RRS":
  print(2)
elif N =="SRR":
  print(2)
else:
  print(1)
Buggy code:

S = input()

if S == 'SSS':
  print(0)
if S == 'RRR':
  print(3)
if S == 'SRR' or S == 'RRS':
  print(2)
else:
  print(1)



Fixed code:
S = input()
if S == "RRR":
    print(3)
elif S == "SSS":
    print(0)
elif S == "RRS" or S == "SRR":
    print(2)
else:
    print(1)
Buggy code:
s=input()
if s=='RRR':
    print(0)
elif s=='SSS':
    print(3)
elif s in ['RRS','SRR']:
    print(2)
else:
    print(1)

Fixed code:
s=input()
if s=='RRR':
    print(3)
elif s=='SSS':
    print(0)
elif s in ['RRS','SRR']:
    print(2)
else:
    print(1)
Buggy code:
temp = str(input())
count = 0
 
for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)

Fixed code:
temp = str(input())
count = 0
max_count = 0 

for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)
Buggy code:
S = input()
if S == 'RRR':
  print(3)
elif S[:3] == 'RR' or S[1:] == 'RR':
  print(2)
elif S == 'SSS':
  print(0)
else:
  print(1)

Fixed code:
wether = input()
if wether == 'SSS':
    print(0)
elif wether == 'RRR':
    print(3)
elif wether[:2] == 'RR' or wether[1:] == 'RR':
    print(2)
else:
    print(1)
Buggy code:
def clean(max_r, count):
  if max_r < count:
      max_r = count
  return max_r

mojiretsu = input()
count = 0
max_r = 0
for moji in mojiretsu:
  if moji == 'R':
    count += 1
  else:
    max_r = clean(max_r, count)
    
if count != 0:
  max_r = clean(max_r, count)
  
print(max_r)

Fixed code:
def clean(max_r, count):
  if max_r < count:
      max_r = count
  return max_r

mojiretsu = input()
count = 0
max_r = 0
for moji in mojiretsu:
  if moji == 'R':
    count += 1
  else:
    max_r = clean(max_r, count)
    count = 0
    
if count != 0:
  max_r = clean(max_r, count)
  
print(max_r)
Buggy code:
s = input() + '@'

lst = [0]*len(s)
for i in range(1,len(s)):
  if s[i] == s[i-1]:
    lst[i] = lst[i-1] + 1
print(max(lst))

Fixed code:
s = input() + '@'

lst = [1]*len(s)
for i in range(1,len(s)):
  if s[i] == s[i-1]:
    lst[i] = lst[i-1] + 1

ans = 0
for i in range(0,len(s)):
	if s[i] == 'R':
		ans = max(ans,lst[i])

print(ans)
Buggy code:
S = input()

ans = 0
tmp = 0
for i in range(3):
    if S[i] == "R":
        tmp += 1
        ans = max(ans, tmp)
    else:
        ans = max(ans, tmp)
        ans = 0

print(ans)


Fixed code:
S = input()

ans = 0
tmp = 0
for i in range(3):
    if S[i] == "R":
        tmp += 1
        ans = max(ans, tmp)
    else:
        ans = max(ans, tmp)
        tmp = 0

print(ans)
Buggy code:
s = input()
if s.count("R"):
    if s.count("RR"):
        if s.count("RRR"):
            print(3)
        else:
            print(2)
    else:
        print(1)
print(0)


Fixed code:
s = input()
if s.count("R"):
    if s.count("RR"):
        if s.count("RRR"):
            print(3)
        else:
            print(2)
    else:
        print(1)
else:
    print(0)
Buggy code:
s=list(input())


c=[]
for i in range(3):
  
  if s[i]=='R':
    cnt=0
    
    while i<3:
      if s[i]=='R':
        cnt+=1
        i+=1
        
      else:
        break
        
    c.append(cnt)
    
print(max(c))
        
        

Fixed code:
s=list(input())


c=[]
for i in range(3):
  cnt=0
  if s[i]=='R':
    
    
    while i<3:
      if s[i]=='R':
        cnt+=1
        i+=1
        
      else:
        break
        
  c.append(cnt)
    
print(max(c))
Buggy code:
s = input()

if s == 'R':
  print(3)
elif s[:3] == "RR" or s[1:] == "RR":
  print(2)
elif 'R' in s:
  print(1)
else:
  print(0)

Fixed code:
s = input()

if s == 'RRR':
  print(3)
elif s[:2] == "RR" or s[1:] == "RR":
  print(2)
elif 'R' in s:
  print(1)
else:
  print(0)
Buggy code:
s = list(input())
l = len(s)
rain =int()
for x in range(l):
  if s[x]=="R":
    rain=rain+1
  else:
    rain=0
print(rain)

Fixed code:
s = list(input())
l = len(s)
rain =int()
maxrain =int()
for x in range(l):
  if s[x]=="R":
    rain=rain+1
    maxrain=rain
  else:
    rain=0
    maxrain=maxrain
print(maxrain)
Buggy code:
S = str(input())

if S == "RRR":
    print(3)
elif S == "RRS" or S == "SRR":
    print(2)
else:
    print(1)

Fixed code:
S = str(input())

if S == "RRR":
    print(3)
elif S == "RRS" or S == "SRR":
    print(2)
elif S == "SSS":
    print(0)
else:
    print(1)
Buggy code:
whether=input(str())
if whether[1]==whether[2]==whether[3]=="R":
    print ("3")
elif whether[1]==whether[2]==whether[3]=="S":
    print ("0")
elif whether[1]==whether[2]=="R" or whether[2]==whether[3]=="R":
    print ("2")
else:
    print ("1")


Fixed code:
whether=str(input())
if whether[0]==whether[1]==whether[2]=="R":
    print ("3")
elif whether[0]==whether[1]==whether[2]=="S":
    print ("0")
elif whether[0]==whether[1]=="R" or whether[1]==whether[2]=="R":
    print ("2")
else:
    print ("1")
Buggy code:

def main():
    s=input()
    if 'RRR'in s:
        ans=3
    elif 'RR' in s:
        ans=2
    elif 'R' in s:
        ans=1
    else:
        ans=1
    print(ans)


if __name__ == "__main__":
    main()


Fixed code:
def main():
    s = input()
    if "RRR" in s:
        ans = 3
    elif "RR" in s:
        ans = 2
    elif "R" in s:
        ans = 1
    else:
        ans = 0
    print(ans)


if __name__ == "__main__":
    main()
Buggy code:
S = input('>>>')
num = 0
num_rev = 0
for i in range(3):
    if S[i] == 'R':
        num += 1
    elif S[i] == 'S':
        num_rev = num
        num = 0
        

print(max(num,num_rev))

Fixed code:
S = input('')
num = 0
num_rev = [0,0,0]
for i in range(3):
    if S[i] == 'R':
        num += 1
    elif S[i] == 'S':
        num_rev[i] = num
        num = 0
        

print(max(num,num_rev[0],num_rev[1],num_rev[2]))
Buggy code:
S = input()
c = 0
cmax = 0
for c in S:
  if c == "R":
    c += 1
    if cmax < c:
      cmax = c
  else:
    c = 0
print(cmax)

Fixed code:
S = input()
cnt = 0
cmax = 0
for c in S:
  if c == "R":
    cnt += 1
    if cmax < cnt:
      cmax = cnt
  else:
    cnt = 0
print(cmax)
Buggy code:
from sys import stdin,stdout
from collections import defaultdict
import math
#input=stdin.readline
#def print(x):stdout.write(str(x)+'\n')
for _ in range(int(input())):
    s=input()
    if s=='RRR':
        print(3)
    elif 'RR' in s:
        print(2)
    elif 'R' in s:
        print(1)
    else:
        print(0)

Fixed code:
from sys import stdin,stdout
from collections import defaultdict
import math
#input=stdin.readline
#def print(x):stdout.write(str(x)+'\n')
s=input()
if s=='RRR':
    print(3)
elif 'RR' in s:
    print(2)
elif 'R' in s:
    print(1)
else:
    print(0)
Buggy code:
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
s=input()
ans=0
if s[0]=="R" and s[1]=="R" and s[2]=="R":
    print(3)
elif s[0]=="R" and s[1]=="R" and s[2]!="R" or s[1]=="R" and s[2]=="R" and s[0]!="R":
    print(2)
elif s[0]=="R" or s[1]=="R" or s[2]=="R":
    print(1)
else:
    print(0

Fixed code:
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
s=input()
ans=0
if s[0]=="R" and s[1]=="R" and s[2]=="R":
    print(3)
elif s[0]=="R" and s[1]=="R" and s[2]!="R" or s[1]=="R" and s[2]=="R" and s[0]!="R":
    print(2)
elif s[0]=="R" or s[1]=="R" or s[2]=="R":
    print(1)
else:
    print(0)
Buggy code:
s = input()
ans = s.count('R')
if s=='RSR':
  ans = 1
print(1)  
  

Fixed code:
s = input()
ans = s.count('R')
if s=='RSR':
  ans = 1
print(ans)
Buggy code:
S = input()

for i in S:
    if i != 'R':
        count = 0
    else:
        count = count + 1
    
    if max_c < count:
        max_c = count
    
print(max_c)

Fixed code:
S = input()
count = 0
max_c = 0

for i in S:
    if i != 'R':
        count = 0
    else:
        count = count + 1
    
    if max_c < count:
        max_c = count
    
print(max_c)
Buggy code:
S=str(input(""))
if 'R' in S:
    print("1")
elif 'RR' in S:
    print("2")
elif 'RRR' in S:
    print("3")
else:
    print("0")

Fixed code:
S = str(input())

if 'RRR' in S:
  print(3)
elif 'RR' in S:
  print(2)
elif 'R' in S:
  print(1)
else:
  print(0)
Buggy code:
s = list(input())
cnt = 0
old = "*"
for i in range(len(s)):
  if s[i] == "R":
    if old == "R":
      cnt += 1
    else:
      cnt = 1
    old = s[i]
print(cnt)    


Fixed code:
s = list(input())
cnt = 0
old = "*"
for i in range(len(s)):
  if s[i] == "R":
    if old == "R":
      cnt += 1
    else:
      cnt = 1
  old = s[i]
print(cnt)
Buggy code:
S = input()
cnt = 0
ans = 0
for i in range(3):
    if S[i] == "R":
        cnt += 1
        ans = max(cnt, ans)
    else:
      cnt = 0
print(cnt)



Fixed code:
S = input()
cnt = 0
ans = 0
for i in range(3):
    if S[i] == "R":
        cnt += 1
        ans = max(cnt, ans)
    else:
      cnt = 0
print(ans)
Buggy code:
S = input()

row_now = 0
row_max = 0
for day in S:
    if day == "S":
        row_now += 1
    else:
        row_now = 0
    if row_now > row_max:
        row_max = row_now

print(row_max)


Fixed code:
S = input()

row_now = 0
row_max = 0
for day in S:
    if day == "R":
        row_now += 1
    else:
        row_now = 0
    if row_now > row_max:
        row_max = row_now

print(row_max)
Buggy code:
S = input()

ans = 0
if S ='RRR': ans = 3
else:
  if ('RR' in S) ans = 2
  else:
    if('R' in S) ans = 1
    else: ans = 0
    
print(ans)

Fixed code:
S = input()
 
ans = 0
if S == 'RRR': ans = 3
else:
  if ('RR' in S): ans = 2
  else:
    if('R' in S): ans = 1
    else: ans = 0
 
print(ans)
Buggy code:
s=input()
for i in range(1,4)[::-1]:
    if "R"*i in s:
        print(i)
        break


Fixed code:
s=input()
for i in range(4)[::-1]:
    if "R"*i in s:
        print(i)
        break
Buggy code:
a = input()

if RRR in a:
  print(3)
elif RR in a:
  print(2)
elif R in a:
  print(1)
else:
  print(0)

Fixed code:
a = input()

if 'RRR' in a:
  print(3)
elif 'RR' in a:
  print(2)
elif 'R' in a:
  print(1)
else:
  print(0)
Buggy code:
S = input()

a = (S[0] == 'S')
b = (S[1] == 'S')
c = (S[2] == 'S')

if a and b and c:
  print(3)
elif (a and b and (c == False)) or ((a == False) and b and c):
  print(2)
elif (a == False) and (b == False) and (c == False):
  print(0)
else:
  print(1)

Fixed code:
S = input()
 
a = (S[0] == 'R')
b = (S[1] == 'R')
c = (S[2] == 'R')
 
if a and b and c:
  print(3)
elif (a and b and (c == False)) or ((a == False) and b and c):
  print(2)
elif (a == False) and (b == False) and (c == False):
  print(0)
else:
  print(1)
Buggy code:
s=[str(i) for i in input()]
if str[0]=='R' and str[1]=='S':
	print(1)
elif str[1]=='S' and str[2]=='R':
	print(1)
elif str[0]=='S' and str[1]=='R' and str[2]=='S':
	print(1)
elif str[0]=='R' and str[1]=='R' and str[2]=='S':
	print(2)
elif str[0]=='S' and str[1]=='R' and str[2]=='R':
	print(2)
elif str[0]=='R' and str[1]=='R' and str[2]=='R':
	print(3)
else:
	print(0)

Fixed code:
s=[str(i) for i in input()]
if s[0]=='R' and s[1]=='S':
	print(1)
elif s[1]=='S' and s[2]=='R':
	print(1)
elif s[0]=='S' and s[1]=='R' and s[2]=='S':
	print(1)
elif s[0]=='R' and s[1]=='R' and s[2]=='S':
	print(2)
elif s[0]=='S' and s[1]=='R' and s[2]=='R':
	print(2)
elif s[0]=='R' and s[1]=='R' and s[2]=='R':
	print(3)
else:
	print(0)
Buggy code:
a=str(input())

if a=="RRR":
  print("3")
  
elif (a=="RRS")or(a=="RSR")or(a=="SRR"):
  print("2")
  
elif (a=="SSS"):
  print("0")
  
else:
  print("1")

Fixed code:
a=input()
if a=='RRR':
  print(3)
elif a=='SRR' or a=='RRS':
  print(2)
elif a=='SSS':
  print(0)
else:
  print(1)
Buggy code:
s=input()
c=0
tmp=0
for i in range(3):
    if s[i]='s':
        tmp+=1
        if c<tmp:
            c=tmp
    else:
        tmp=0
print(c)

Fixed code:
s=input()
c=0
tmp=0
for i in range(3):
    if s[i]=='R':
        tmp+=1
        if c<tmp:
            c=tmp
    else:
        tmp=0
print(c)
Buggy code:
s = input()
rain = 0
ans = 0
for i in s:
  if i == "R":
    rain += 1
    ans = max(ans, rain)
  else:
    rain = 0
print(rain)

Fixed code:
s = input()
rain = 0
ans = 0
for i in s:
  if i == "R":
    rain += 1
    ans = max(ans, rain)
  else:
    rain = 0
print(ans)
Buggy code:
S=str(input())
if S[1]=="R":
  if S[2]=="R" and S[0]=="R":
    print(3)
  else:
    if S[0]=="R":
      print(2)
    if S[2]=="R":
      print(2)
    else:
      print(1)
else:
  if S[2]=="R" or S[0]=="R":
    print(1)
  else:
    print(0)

Fixed code:
S=str(input())
if S[1]=="R":
  if S[2]=="R" and S[0]=="R":
    print(3)
  else:
    if S[0]=="R":
      print(2)
    elif S[2]=="R":
      print(2)
    else:
      print(1)
else:
  if S[2]=="R" or S[0]=="R":
    print(1)
  else:
    print(0)
Buggy code:
S = input()
c = 0
m = 0
if s in S:
  if s == "R":
    c+=1
    m = max(c, m)
  else:
    m = max(c, m)
    c = 0
print(m)
    
    

Fixed code:
S = input()
c = 0
m = 0
for s in S:
    m = max(c, m)
    if s == "R":
        c += 1
        m = max(c, m)
    else:
        c = 0
print(m)
Buggy code:
n = int(input())
l = sorted(map(int,input().split()))

print(l)
ans = 0

for a in range(n):
    for b in range(a+1,n):
        for c in range(b+1,n):
            if  l[a] != l[b] != l[c] and l[a]+l[b] > l[c]:
                ans += 1
print(ans)

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

ans = 0

for a in range(n):
    for b in range(a+1,n):
        for c in range(b+1,n):
            if  l[a] != l[b] != l[c] and l[a]+l[b] > l[c]:
                ans += 1
print(ans)
Buggy code:
N = int(input())
L = [int(i) for i in input().split()]

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


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

ans = 0
for i in range(N):
    for j in range(i):
        for k in range(j):
            if L[i] != L[j] and L[j] != L[k] and L[k] != L[i] and L[i] + L[j] > L[k] and L[i] + L[k] > L[j] and L[j] + L[k] > L[i]:
                ans += 1
print(ans)
Buggy code:
N = input()
L = map(int, split(input()))

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

ans = 0
for i in range(0, N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            arr = [L[i], L[j], L[k]]
            arr.sort()
            if (arr[0] != arr[1] & arr[1] != arr[2]):
                if (arr[2] < arr[0] + arr[1]):
                    ans = ans + 1

print(ans)


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

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

ans = 0
for i in range(0, N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            arr = [L[i], L[j], L[k]]
            arr.sort()
            if (arr[0] != arr[1] & arr[1] != arr[2]):
                if (arr[2] < arr[0] + arr[1]):
                    ans = ans + 1

print(ans)
Buggy code:
 a = int(input())
 p = list(map(int,input().split()))
 count = 0
 for i in range(a):
     for s in range(a):
         for t in range(a):
             if p[t]<p[s]<p[i] and p[t]+p[s]>p[i]:
                 count+=1
print(count)

Fixed code:
a = int(input())
p = list(map(int,input().split()))
count = 0

for i in range(a):
     for s in range(a):
         for t in range(a):
             if p[t]<p[s]<p[i] and p[t]+p[s]>p[i]:
                 count+=1
print(count)
Buggy code:
n = int(input())
lst = 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):
			if lst[i] != lst[j] and lst[j] != lst[k] and lst[i] + lst[j] > lst[k] and lst[i] + lst[k] > lst[j] and lst[j] + lst[j] > lst[i]:
				cnt += 1
print(cnt)

Fixed code:
n = int(input())
lst = 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):
			if lst[i] != lst[k] and lst[i] != lst[j] and lst[j] != lst[k] and lst[i] + lst[j] > lst[k] and lst[i] + lst[k] > lst[j] and lst[j] + lst[k] > lst[i]:
				cnt += 1
print(cnt)
Buggy code:
mport itertools as it


N = int(input())
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
        continue
    if (i[0] + i[1]) > i[2]:
        count += 1

print(count)

Fixed code:
import itertools as it


N = int(input())
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    listed = list(i)
    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
        continue
    if (listed[0] + listed[1]) > listed[2]:
        count += 1

print(count)
Buggy code:
N = int(input())
L = [int(x) for x in input().split()]
sum = 0
for i in range(N):
    for j in range(i+1,N):
        if L[i] == L[j]:
            continue
        for k in range(j+1,N):
            if 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[k]+L[j]>L[i]:
                print(L[i],L[j],L[k])
                sum += 1
print(sum)


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

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[i] != L[k] and L[j] != L[k]) and (L[i] + L[j] > L[k] and L[i] + L[k] > L[j] and L[j] + L[k] > L[i]):
                cnt += 1
print(cnt)

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

Fixed code:
N = int(input())
L = list(map(int, input().split()))
cnt = 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] or L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i] + L[j] <= L[k] or L[i] + L[k] <= L[j] or L[j] + L[k] <= L[i]:
                continue
            cnt += 1
print(cnt)