qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n=int(input())
  if n==7 or n==5 or n==3:
	print('YES')
  else
    print('NO')
    

Fixed code:
n=int(input())
print('YES' if n == 7 or n == 5 or n == 3 else 'NO')
Buggy code:
x=int(input())
if x == 3 or == 5 or x == 7:
  print("YES")
 else
print("NO")

Fixed code:
x=int(input())
if x==3 or x==5 or x==7:print('YES')
else:print('NO')
Buggy code:
x = int(input())
ans ="NO"
if 2<x<8 and x%2==1:
    ans ="YES"
print("NO")


Fixed code:
x = int(input())
ans ="NO"
if 2<x<8 and x%2==1:
    ans ="YES"
print(ans)
Buggy code:
a = int,input()
if(a==7 or a==5 or a==3):
  print('YES')
else:
  print('NO')

Fixed code:
a = int(input())
if(a==7 or a==5 or a==3):
  print("YES")
else:
  print("NO")
Buggy code:
X = int(input())

if X == 3 or X == 5 or x == 7:
  print("YES")
else:
  print("NO")

Fixed code:
x = int(input())
if x == 7 or x == 5 or x == 3:
    print('YES')
else:
    print('NO')
Buggy code:
age = int(input())
if age == 3:
  print("YES")
if age == 5:
  print("YES")
if age == 7:
  print("YES")
else:
  print("NO")

Fixed code:
age = int(input())
if age == 3:
  print("YES")
elif age == 5:
  print("YES")
elif age == 7:
  print("YES")
else:
  print("NO")
Buggy code:
X=input()
if X==7 or X==5 or X==3:
    print("YES")
else:
    print("NO")

Fixed code:
X = int(input())
 
if X == 3 or X == 5 or X == 7:
  print("YES")
else:
  print("NO")
Buggy code:
def main():
    x = int(input())
    ans = "NO"
    if (x == 7 or x == 5 or x == 3):
        ans = "YES"

    print(ans)


if __name__ == '__main__':
    main()


Fixed code:
def main():
    x = int(input())
    ans = "NO"
    if (x == 7 or x == 5 or x == 3):
        ans = "YES"

    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
X=int(input())
if X=3 or X=5 or X=7:
  print('YES')
else:
  print('NO')

Fixed code:
X = int(input())

if X == 3 or X == 5 or X == 7:
	print("YES")
else:
	print("NO")
Buggy code:
x  = int(input())
if x == 3 or x == 5 or x == 7:
    print('YES')
else:
    print('NO')

Fixed code:
x=int(input())
if x==7 or x==5 or x==3:
  print("YES")
else:
  print("NO")
Buggy code:
if int(input) in [7, 5, 3]: print("YES")
else: print("NO")

Fixed code:
if int(input()) in [7, 5, 3]: print("YES")
else: print("NO")
Buggy code:
X = input()
if X == 3 or X == 5 or X == 7:
    print("YES")
else:
    print("NO")


Fixed code:
X = int(input())
if X == 3 or X == 5 or X == 7:
    print ('YES')
else:
    print ('NO')
Buggy code:
a=int(input())
if a=3 or a=5 or a=7:
    print("YES")
else:
    print("NO ")

Fixed code:
a=int(input())
if a==3 or a==5 or a==7:
    print("YES")
else:
    print("NO ")
Buggy code:
x = input()
if x == 3 or x == 5 or x == 7:
    print('YES')
else:
  print('NO')


Fixed code:
x = int(input())

if x == 3 or x == 5 or x == 7:
    print('YES')

else:
    print('NO')
Buggy code:
x=int(input())
if x = 7 or x = 5 or x = 3:
  print("YES")
else:
  print("NO")

Fixed code:
x=int(input())
if x == 7 or x == 5 or x == 3:
  print("YES")
else:
  print("NO")
Buggy code:
s=input()

ans=10**10

for i in range(len(s)):
  try:
    ans=min(ans,abs(int(s[i:i+2])-753))
  except:pass

  try:
    ans=min(ans,abs(int(s[i:i+3])-753))
  except:pass
  
  try:
    ans=min(ans,abs(int(s[i:i+4])-753))
  except:pass
print(ans)

Fixed code:
s=input()

ans=10**10

for i in range(len(s)):
  try:
    ans=min(ans,abs(int(s[i:i+3])-753))
  except:pass
print(ans)
Buggy code:
s = input()
ans = 1000
for i in range(len(s) - 3):
  ans = min(ans, abs(int(s[i:i + 3]) - 753))
print(ans)

Fixed code:
s = input()
ans = 1000
for i in range(len(s) - 2):
  ans = min(ans, abs(int(s[i:i + 3]) - 753))
print(ans)
Buggy code:
s = input()
max_n = 10000
min_n = 0
for n in range(0, len(s) - 2):
    min_n = min(abs(int(s[n:n + 3]) - 753), max_n)
print(min_n)

Fixed code:
s = input()
min_n = 10000
for n in range(0, len(s) - 2):
    min_n = min(abs(int(s[n:n + 3]) - 753), min_n)
print(min_n)
Buggy code:
s = input()
a = []
for i in range(len(s)-2):
  a.append(abs(753 - int(s[i:i+2])))
print(min(a))
  
  

Fixed code:
s = input()
a = []
for i in range(len(s)-2):
  a.append(abs(753 - int(s[i:i+3])))
print(min(a))
Buggy code:
import math;print((lambda x:int(min([math.fabs(int(x[i:i+3])-753) for i in range(len(x)-3)])))(input()))

Fixed code:
import math;print((lambda x:int(min([math.fabs(int(x[i:i+3])-753) for i in range(len(x)-2)])))(input()))
Buggy code:
s = input()
print([ abs(753-int(s[i:i+3])) for i in range(len(s)-2) ])

Fixed code:
s = input()
print(min(abs(753-int(s[i:i+3])) for i in range(len(s)-2)))
Buggy code:
S = list(input())

ans = 753

for i in range(len(S)-2):
    sa = abs(753-(int(S[i])*100 + int(S[i+1])*10 + int(S[i+2])))
    ans = min(sa,ans)
             
print(ans

Fixed code:
S = list(input())

ans = 753

for i in range(len(S)-2):
    sa = abs(753-(int(S[i])*100 + int(S[i+1])*10 + int(S[i+2])))
    ans = min(sa,ans)
             
print(ans)
Buggy code:
S=input();print(min([abs(int(S[i:i+3])-753) for i in range(len(S)-3)])+753)

Fixed code:
S=input();print(min([abs(int(S[i:i+3])-753) for i in range(len(S)-2)]))
Buggy code:
s = input()
diff = 99999
for i in range(len(s)-2):
    j = int(s[i:i+3])
    print(j)
    if abs(753-j) < diff:
        diff = abs(753-j)
print(diff)

Fixed code:
s = input()
diff = 99999
for i in range(len(s)-2):
    j = int(s[i:i+3])
    #print(j)
    if abs(753-j) < diff:
        diff = abs(753-j)
print(diff)
Buggy code:
a = input()
c=0
for i in range(len(a)-2):
    b=int(a[i:i+3])
    if abs(753-c) > abs(753-b):
        c=b
print(753-c)

Fixed code:
a = input()
c=0
for i in range(len(a)-2):
    b=int(a[i:i+3])
    if abs(753-c) > abs(753-b):
        c=b
print(abs(753-c))
Buggy code:
n=input()
print(min(abs(int(n[i:i+3])-753 for i in range(len(n)))))

Fixed code:
n=input()
print(min(abs(int(n[i:i+3])-753) for i in range(len(n))))
Buggy code:
s=input()
ans=999
for i in range(s.len()-2):
  ans=min(abs(753-int(s[i:i+2])),ans)
print(ans)

Fixed code:
s=input()
ans=999
for i in range(len(s)-2):
  ans=min(abs(753-int(s[i:i+3])),ans)
print(ans)
Buggy code:
s = list(input())
l = []
for i in range(len(s)):
	l.append(s[i])
print(l)
mindiff = 10**6
for i in range(len(l)-2):
	n = int("".join(l[i:i+3]))
	diff = abs(753 - n)
	if mindiff > diff:
		mindiff = diff

print(mindiff)


Fixed code:
s = list(input())
l = []
for i in range(len(s)):
	l.append(s[i])
mindiff = 10**6
for i in range(len(l)-2):
	n = int("".join(l[i:i+3]))
	diff = abs(753 - n)
	if mindiff > diff:
		mindiff = diff

print(mindiff)
Buggy code:
S = input()
ans = 753
for i in range(len(S) - 2):
	tmp = S[i] * 100 + S[i + 1] * 10 + S[i + 2]
	if abs(tmp - 753) < ans:
		ans = tmp
print(ans)


Fixed code:
S = input()
ans = 753
for i in range(len(S) - 2):
	tmp = abs(int(S[i]) * 100 + int(S[i + 1]) * 10 + int(S[i + 2]) - 753)
	if tmp < ans:
		ans = tmp
print(ans)
Buggy code:
s = input()

x = 1000
for i in range(len(s)-3):
    tmp = abs(753 - int(s[i:i+3]))
    if(x > tmp):
        x=tmp
print(x)
    

Fixed code:
s = input()

x = 1000
for i in range(len(s)-2):
    tmp = abs(753 - int(s[i:i+3]))
    if(x > tmp):
        x=tmp
print(x)
Buggy code:
S = input()
ans = 999
for i in range(S - 2):
  ans = min(ans, abs(753 - int(S[i:i + 3])))
print(ans)

Fixed code:
S = input()
ans = 999
for i in range(len(S) - 2):
  ans = min(ans, abs(753 - int(S[i:i + 3])))
print(ans)
Buggy code:
s = input()
l = len(s)
r = 10000
for i in range(l-3):
	p = s[i] + s[i+1] + s[i+2]
    x = int(p)
    r = min(r, abs(x-753))
print(r)

Fixed code:
s = input()
l = len(s)
r = 10000
for i in range(l-2):
	p = s[i] + s[i+1] + s[i+2]
	x = int(p)
	r = min(r, abs(x-753))
print(r)
Buggy code:
import sys
input = sys.stdin.readline

s = input()
m = 250
for i in range(len(s)-2):
  num = abs(int(s[i:i+3]) - 753)
  if num < m:
    m = num
print(m)    
  


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

s = input()
m = 755
for i in range(len(s)-2):
  num = abs(int(s[i:i+3]) - 753)
  if num < m:
    m = num
print(m)
Buggy code:
s = input()
imin = 753
for i in range(len(s)-2):
  if(abs(int(s[i] + s[i+1] + s[i+2]) - 753) < imin:
     imin = abs(int(s[i] + s[i+1] + s[i+2])-753)
print(imin)

Fixed code:
s = input()
imin = 753
for i in range(len(s)-2):
  if(abs(int(s[i] + s[i+1] + s[i+2]) - 753) )< imin:
     imin = abs(int(s[i] + s[i+1] + s[i+2])-753)
print(imin)
Buggy code:
S = input()

dif = []

i = 0

while i < len(S)-3:
  s = int(S[i:i+3])
  diff = abs(753-s)
  dif.append(diff)
  i += 1

print(min(dif))
  

Fixed code:
S = input()
 
dif = []
 
i = 0
 
while i < len(S)-2:
  s = int(S[i:i+3])
  diff = abs(753-s)
  dif.append(diff)
  i += 1
print(min(dif))
Buggy code:
s = input()

m = 1000000
for i in range(len(s)-3):
  x = int(s[i:i+3])
  m = min(m,abs(x-753))
  
print(m)

Fixed code:
s = input()

m = 1000000
for i in range(len(s)-2):
  x = int(s[i:i+3])
  m = min(m,abs(x-753))
  
print(m)
Buggy code:
a=input()
ans=999
for i in range(len(a)-2):
  b=abs(765-int(a[i:i+3]))
  ans=min(ans,b)
print(ans)

Fixed code:
a=input()
ans=999
for i in range(len(a)-2):
  b=abs(753-int(a[i:i+3]))
  ans=min(ans,b)
print(ans)
Buggy code:
#B - 754
S = list(map(int,input()))
print(S)
minimam = 987
for i in range(len(S)-2):
    X = 100*S[i] + 10*S[(i+1)] + S[(i+2)]
    if abs(X - 753)<minimam:
        minimam = abs(X - 753)
print(minimam)

Fixed code:
#B - 754
S = list(map(int,input()))

minimam = 987
for i in range(len(S)-2):
    X = 100*S[i] + 10*S[(i+1)] + S[(i+2)]
    if abs(X - 753)<minimam:
        minimam = abs(X - 753)
print(minimam)
Buggy code:
n = input()
a = [int(n[i:i+3]) for i in range(len(n)-3)]
ans = abs(a[0]-753)
for i in a:
  b = abs(a[i]-753)
  if b < ans:
    ans = b
print(ans)
  

Fixed code:
n = input()
a = [int(n[i:i+3]) for i in range(len(n)-2)]
ans = abs(a[0]-753)
for i in a:
  b = abs(i-753)
  if b < ans:
    ans = b
print(ans)
Buggy code:
s=str(input())
s=list(s)
ans=999
for i in range(0,len(s)-2):
  temp=s[i]*100+s[i+1]*10+s[i+2]
  ans=min(ans,abs(753-temp))
print(ans)  

Fixed code:
s=str(input())
s=list(s)
ans=999
for i in range(0,len(s)-2):
  temp=int(s[i])*100+int(s[i+1])*10+int(s[i+2])
  ans=min(ans,abs(753-temp))
print(ans)
Buggy code:
s = input()
m = 1000
for i in range(0,len(s)-2):
    m = min(abs(s[i]*100+s[i+1]*10+s[i+2]-753),m)
print(m)

Fixed code:
s = input()
m = 1000
for i in range(0,len(s)-2):
    m = min(abs(int(s[i])*100+int(s[i+1])*10+int(s[i+2])-753),m)
print(m)
Buggy code:
S = input()
vals = []
for i in range(len(S) - 2):
    vals.append(abs(754 - int(S[i:i+3])))
print(min(vals))


Fixed code:
S = input()
vals = []
for i in range(len(S) - 2):
    vals.append(abs(753 - int(S[i:i+3])))
print(min(vals))
Buggy code:
s = str(input())
m = abs(753,s[0]*100+s[1]*10+s[2])
for i in range(1,len(s)-2):
  a = s[i]*100+s[i+1]*10+s[i+2]
  m = min(m,abs(753,a))
  
print(m)
  


Fixed code:
s = str(input())
m = abs(753-int(s[0])*100-int(s[1])*10-int(s[2]))
for i in range(1,len(s)-2):
  a = int(s[i])*100+int(s[i+1])*10+int(s[i+2])
  m = min(m,abs(753-a))
  
print(m)
Buggy code:
s=input()
n=len(s)
print(min((abs(753-int(s[i:i+3])) for i in range(n-2)))

Fixed code:
s=input()
n=len(s)
print(min((abs(753-int(s[i:i+3])) for i in range(n-2))))
Buggy code:
X=input()
print(min(abs(int(S[i:i+3])-753) for i in range(len(S)-2)))


Fixed code:
S=input()
print(min(abs(int(S[i:i+3])-753)for i in range(len(S)-2)))
Buggy code:
a=input()
l=len(a)
b=a[0]+a[1]+a[2]
for i in range(0,l-3):
  if int(a[i]+a[i+1]+a[i+2])<=int(a[i+1]+a[i+2]+a[i+3]):
    b=a[i+1]+a[i+2]+a[i+3]
print(abs(753-int(b)))
    

Fixed code:
a=input()
l=len(a)
if(l<=3):
    b=abs(753-int(a))
    print(b)
else:
    b=[0]*(l-2)
    for i in range(0,l-2):
        b[i]=abs(753-int(a[i]+a[i+1]+a[i+2]))
    print(min(b))
Buggy code:
s = input()
minimum = 753
for i in range(len(s)-2):
  x = int(s[i:i+3])
  minimum = (minimum,abs(x-753))
print(minimum)

Fixed code:
s = input()
minimum = 753
for i in range(len(s)-2):
  x = int(s[i:i+3])
  minimum = min(minimum,abs(x-753))
print(minimum)
Buggy code:
s=input()
ans=[]
for i in range(len(s)-2):
  a=int(s[i])*100+int(s[i+1])*10+int(s[i+2])
  ans.append(abs(a-753))
for i in range(len(s)-3):
  a=int(s[i])*1000+int(s[i+1])*100+int(s[i+2])*10+int(s[i+3])
  ans.append(abs(a-753))
print(min(ans))

Fixed code:
s=input()
ans=[]
for i in range(len(s)-2):
  a=int(s[i])*100+int(s[i+1])*10+int(s[i+2])
  ans.append(abs(a-753))
print(min(ans))
Buggy code:
S = input()
ans = 99999
for i in range(len(S)-2):
    ans = min(ans, abs(int(S[i:i+3]), 753))
print ans

Fixed code:
S = input()

ans = min(abs(int(S[i:i+3]) - 753) for i in range(len(S) - 2))
print(ans)
Buggy code:
S = input()
print(min(abs(int(S[i:i+3]) - 753)) for i in range(len(S) - 2)

Fixed code:
s = input()
print( min([abs(753 -int(s[i:i+3])) for i in range(len(s)-2)]))
Buggy code:
a = input()
minans =  753

for i in range(len(a)-3):
    ans = abs(int(a[i:i+3]) - 753)
    if minans > ans:
        minans = ans

print(ans)

Fixed code:
a = input()
minans =  753

for i in range(len(a)):
    ans = abs(int(a[i:i+3]) - 753)
    if minans > ans:
        minans = ans

print(minans)
Buggy code:
from __future__ import print_function
import numpy as np
import sys
import math,string,itertools,fractions,heapq,collections,re,array,bisect,copy,functools
# from itertools import accumulate
# from collections import deque
import random

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

# l = list(map(int, input().split()))
# n = int(input())
# l = list(map(int, input().split()))
# l = np.array(list(map(int, input().split())))
# l = np.array(list(map(int, input().split())))
s = input()
min = sys.maxsize
for i in range(len(s)-2):
    div = int(s[i:i+3])
    # if abs(sum-753) = :
    min = abs(div-753) if abs(div-753)<min else min
    print(min)
print(min)


Fixed code:
from __future__ import print_function
import numpy as np
import sys
import math,string,itertools,fractions,heapq,collections,re,array,bisect,copy,functools
# from itertools import accumulate
# from collections import deque
import random

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

# l = list(map(int, input().split()))
# n = int(input())
# l = list(map(int, input().split()))
# l = np.array(list(map(int, input().split())))
# l = np.array(list(map(int, input().split())))
s = input()
min = sys.maxsize
for i in range(len(s)-2):
    div = int(s[i:i+3])
    # if abs(sum-753) = :
    min = abs(div-753) if abs(div-753)<min else min
print(min)
Buggy code:
S = input()
ans = 99999
for i in range(len(S)-2):
  ans = min(ans, abs(S[i:i+3], 753)
            
print ans

Fixed code:
S = input()
ans = 99999
for i in range(len(S)-2):
    ans = min(ans, abs(int(S[i:i+3])-753))
print(ans)
Buggy code:
s=input()
ans = 653
for i in range(len(s)-3):
    x = abs(753 - int(s[i:i+3]))
    ans = min(ans,x)
print(ans)

Fixed code:
s=input()
ans = 653
for i in range(len(s)-2):
    x = abs(753 - int(s[i:i+3]))
    ans = min(ans,x)
print(ans)
Buggy code:
line=list(input())
like=753
difference=0
ans=999-like

for i in range(len(line)-2):
   
    this=100*int(line[i])+10*int(line[i+1])+int(line[i+2])
    if this>=like:
        difference=this-like
    else:
        difference=like-this
    
    if difference<ans:
        ans=difference

print(ans)

Fixed code:
line=list(input())
like=753
difference=0
ans=like

for i in range(len(line)-2):
   
    this=100*int(line[i])+10*int(line[i+1])+int(line[i+2])
    if this>=like:
        difference=this-like
    else:
        difference=like-this
    
    if difference<ans:
        ans=difference

print(ans)
Buggy code:
x = str(input())
target = 753
ok = 999
for i in range(len(x)-2):
	num = x[i:i+3]
	sa = abs(target - int(num))
	if (ok < sa):
		ok = sa
print (sa)

Fixed code:
x = str(input())
target = 753
ok = 999
for i in range(len(x)-2):
	num = x[i:i+3]
	sa = abs(target - int(num))
	if (ok > sa):
		ok = sa
	#print (sa)
print (ok)
Buggy code:
s = input()
ans = 104206969
for i in range(len(s)-3):
  ans = min(ans, abs(753-int(s[i:i+3])))
print ans

Fixed code:
s = input()
ans = 104206969
for i in range(len(s)-2):
  ans = min(ans, abs(753-int(s[i:i+3])))
print(ans)
Buggy code:
s = input()
ans = 10000000
for i in range(len(s)-3):
	n = int(s[i:i+3])
	ans = min(ans,max(n-753,753-n))
print(ans)

Fixed code:
s = input()
ans = 10000000
for i in range(len(s)-2):
	n = int(s[i:i+3])
	ans = min(ans, max(n-753,753-n))
print(ans)
Buggy code:
S = input()
N = len(S)

ans = 753
for i in range(N - 3):
    ans = min(ans, abs(int(S[i:i + 3]) - 753))
print(ans)


Fixed code:
S = input()
N = len(S)

ans = 753
for i in range(N - 2):
    ans = min(ans, abs(int(S[i:i + 3]) - 753))
print(ans)
Buggy code:
s = input()
i = 0
a = []
while i <= len(s)-2:
  t = s[i:i+2]
  a.append(abs(753-int(t)))
  i += 1
  
print(min(a))

Fixed code:
s = input()
i = 0
a = []
while i <= len(s)-3:
  t = s[i:i+3]
  a.append(abs(753-int(t)))
  i += 1
  
print(min(a))
Buggy code:
s = input()
ans = float("inf")
for i in range(len(s)-3):
  curr = int(s[i:i+3])
  ans = min(ans, abs(753 - curr))
  
print(ans)

Fixed code:
s = input()
ans = float("inf")
for i in range(len(s)-2):
  curr = int(s[i:i+3])
  ans = min(ans, abs(753 - curr))
  
print(ans)
Buggy code:
X = input()
l = len(X)

result = 1000
for i in range(l-2):
    num = int(X[i:i+3])
    if num - 753 < result:
        result = num-753

print(result)

Fixed code:
X = input()
l = len(X)

result = 1000
for i in range(l-2):
    num = abs(int(X[i:i+3]) - 753)
    if num < result:
        result = num

print(result)
Buggy code:
s=input()
l=[]
for i in range(len(s)-2):
  l.append(753-int(s[i:i+3]))
print(min(l))

Fixed code:
s=input()
l=[]
for i in range(len(s)-2):
  l.append(abs(753-int(s[i:i+3])))
print(min(l))
Buggy code:
S=input()
a=500
for i in range(len(S)):
    s=abs(int(S[i:i+3])-753)
    if(s<a):
        a=s
print(a)

Fixed code:
S=input()
a=900
for i in range(len(S)):
    s=abs(int(S[i:i+3])-753)
    if(s<a):
        a=s
print(a)
Buggy code:
S=input()
ans = 111111111;
for i in range(2,10):
    temp = abs(753 - (100 * int(S[i - 2]) + 10 * int(S[i - 1]) + int(S[i])))
    ans = min(ans, temp)
print(ans)

Fixed code:
S=input()
ans = 111111111
for i in range(2,len(S)):
    temp = abs(753 - (100 * int(S[i - 2]) + 10 * int(S[i - 1]) + int(S[i])))
    ans = min(ans, temp)
print(ans)
Buggy code:
s = input()

ans = 1000
for i in range(len(s)-2):
  ans = min(ans, abs(int(s[i:i+3])))
print(ans)
  

Fixed code:
s = input()

ans = 1000
for i in range(len(s)-2):
  ans = min(ans, abs(753-int(s[i:i+3])))
print(ans)
Buggy code:
in = input()

result = 999

for i in range(len(in)-2):
  if i == len(in) - 3:
    num = in[i:]
  else:
    num = in[i:i+3]

  sa = abs(753 - int(num))

  if sa < result:
    result = sa

print(result)


Fixed code:

inn = str(input())

result = 999

for i in range(len(inn)-2):
  if i == len(inn) - 3:
    num = inn[i:]

  else:
    num = inn[i:i+3]

  sa = abs(753 - int(num))

  if sa < result:
    result = sa

print(result)
Buggy code:
str1 = input()

len1 = len(str1)
diff = 999

for x in range (len1-2):
    num = int(str1[x:x+3])
    print (num, diff)
    if abs(num-753) <diff:
        diff = abs(num-753)
print (diff)

Fixed code:
str1 = input()

len1 = len(str1)
diff = 999

for x in range (len1-2):
    num = int(str1[x:x+3])
    if abs(num-753) <diff:
        diff = abs(num-753)
print (diff)
Buggy code:
s=int(input())
t=[]
for i in range(len(s)-2):
  a=s[i:i+2]
  t.append(abs(a-753))
print(min(t))

Fixed code:
s=input()
t=[]
for i in range(len(s)-2):
  a=int(s[i:i+3])
  t.append(abs(a-753))
print(min(t))
Buggy code:
s=input()
t=753
for i in range(len(s)-2):
  a=int(s[i:i+2])
  if t>abs(a-753):
    t=abs(a-753)
print(t)


Fixed code:
s=input()
t=753
for i in range(len(s)-2):
    a=int(s[i:i+3])
    if t>abs(a-753):
        t=abs(a-753)
print(t)
Buggy code:
s = input()
t = 753
x = 0

for i in range(1,len(s)-3) :
   x = 100*int(s[i]) + 10*int(s[i+1]) + int(s[i+2])
   t = min(t,abs(x-753))

print(t)

Fixed code:
s = input()
t = 753
x = 0

for i in range(len(s)-2) :
   x = 100*int(s[i]) + 10*int(s[i+1]) + int(s[i+2])
   t = min(t,abs(x-753))

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

ans = 10**9
for i in range(len(S) - 3):
    x = S[i:i+3]
    now = abs(int(x) - 753)
    ans = min(ans, now)
print(ans)

Fixed code:
S = input()

ans = 10**9
for i in range(len(S) - 2):
    x = S[i:i+3]
    now = abs(int(x) - 753)
    ans = min(ans, now)
print(ans)
Buggy code:
s=input()
print(abs(min([753-int(''.join(s[i:i+3])) for i in range(len(s)-2)])))

Fixed code:
s=input()
print(min([abs(753-int(''.join(s[i:i+3]))) for i in range(len(s)-2)]))
Buggy code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = input()
    ans = 1000
    for i in range(len(S) - 3):
        s = int(S[i:i + 3])
        ans = min(ans, (abs(s - 753)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = input()
    ans = 1000
    for i in range(len(S) - 2):
        s = int(S[i:i + 3])
        ans = min(ans, (abs(s - 753)))
    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
S=input()
length=len(S)
ans=[]
for i in range(S-2):
  num=int(S[i:i+3])
  ans.append(abs(num-753))
print(min(ans))

Fixed code:
S=input()
length=len(S)
ans=[]
for i in range(length-2):
  num=int(S[i:i+3])
  ans.append(abs(num-753))
print(min(ans))
Buggy code:
s = str(input()).strip()
nums = []
for i in range(len(s)-2):
    nums.append(abs(int(s[i:i+3]) - 753))
print(max(nums))


Fixed code:
s = str(input()).strip()
nums = []
for i in range(len(s)-2):
    nums.append(abs(int(s[i:i+3]) - 753))
print(min(nums))
Buggy code:
s = input()
dist = 1000
for i in range(len(s)-3) :
    x = int(s[i:i+3])
    d = abs(753-x)
    if d < dist :
        love = d
print(love)

Fixed code:
s = input()
dist = 1000
for i in range(len(s)-2) :
    x = int(s[i:i+3])
    d = abs(753-x)
    if d < dist :
        dist = d
print(dist)
Buggy code:
S = input()
print(min([753 - int(S[i:i+3]) for i in range(len(S)-3 + 2)]))


Fixed code:
S = input()
print(min([abs(753 - int(S[i:i+3])) for i in range(len(S)-3 + 2)]))
Buggy code:
s=list(input())
d=[]
for a in range(len(s)-2):
	b=s[a:a+3]
	c=''.join(b)
	e=754-int(c)
	d.append(e)
print(abs(min(d)))

Fixed code:
s=list(input())
d=[]
for a in range(len(s)-2):
	b=s[a:a+3]
	c=''.join(b)
	e=753-int(c)
	d.append(abs(e))
print(min(d))
Buggy code:
S = list(input())
mini = 800

for i in range(len(S)-2):
  s_num =  100 * int(S[i]) + 10 * int(S[i+1]) + int(S[i+2])
  a = abs(753 - s_num) 
  if a < mini:
    mini = a
    
print(a)

Fixed code:
S = list(input())
mini = 800

for i in range(len(S)-2):
  s_num =  100 * int(S[i]) + 10 * int(S[i+1]) + int(S[i+2])
  a = abs(753 - s_num) 
  if a < mini:
    mini = a
    
print(mini)
Buggy code:
s = input().strip()

min_diff = 1000000

for i in range(len(s) - 2):
    num = int(s[i: i+3])
    print(num)
    diff = abs(753 - num)
    min_diff = min(diff, min_diff)

print(min_diff)


Fixed code:
s = input().strip()

min_diff = 1000000

for i in range(len(s) - 2):
    num = int(s[i: i+3])
    diff = abs(753 - num)
    min_diff = min(diff, min_diff)

print(min_diff)
Buggy code:
from sys import stdin
S = input()

ans = 10**9
for i in range(len(S)-1):
    ans = min(abs(int(S[i:i+2])-753), ans)
print(ans)


Fixed code:
from sys import stdin
S = input()

ans = 10**9
for i in range(len(S)-2):
    ans = min(abs(int(S[i:i+3])-753), ans)
print(ans)
Buggy code:
a = input()
b = 753
res = float("inf")
l = len(a)

for i in range(1,l-3):
    n = abs(b-int(a[i:i+3]))
    if res > n:
        res = n
        
print(n)    


Fixed code:
a = input()
b = 753
res = float("inf")
l = len(a)

for i in range(0,l-2):
    n = abs(b-int(a[i:i+3]))
    if res > n:
        res = n
        
print(int(res))
Buggy code:
S = input()
ans = 0xdeadbeef
for i in range(len(S)-3):
    ans = min(ans, abs(int(S[i:i+3]) - 753))

print(ans)


Fixed code:
S = input()
ans = 0xdeadbeef
for i in range(len(S)-2):
    ans = min(ans, abs(int(S[i:i+3]) - 753))

print(ans)