qyliang/CodeNanoFix huggingface dataset:
Buggy code:
string = input()
min = 999
for i in range(len(string)-3):
  num = 100 * int(string[i]) + 10 * int(string[i+1]) + int(string[i+2])
  if abs(num-753) < min:
    min = abs(num-753)
print(min)

Fixed code:
string = input()
min = 999
for i in range(len(string)-2):
  num = 100 * int(string[i]) + 10 * int(string[i+1]) + int(string[i+2])
  if abs(num-753) < min:
    min = abs(num-753)
print(min)
Buggy code:
s = input()
lst = []
for i in range(2, len(s)):
  print(s[i-2:i+1])
  lst.append(abs(int(s[i-2:i+1]) - 753))
print(min(lst))

Fixed code:
s = input()
lst = []
for i in range(2, len(s)):
  lst.append(abs(int(s[i-2:i+1]) - 753))
print(min(lst))
Buggy code:
S = int(input())
ans = int(999)
diff = int(0)

for i in range(0, len(S) - 2):
    diff = abs(int(S[i:i+3]) - 753)
    if ans > diff:
        ans = diff
print(ans)

Fixed code:
S = input()
ans = int(999)
diff = int(0)

for i in range(0, len(S) - 2):
    diff = abs(int(S[i:i+3]) - 753)
    if ans > diff:
        ans = diff
print(ans)
Buggy code:
nums = input()
m_s = 999
X = 753
ans = 999
for i in range(len(nums)-2):
  num = int(nums[i:i+3])
  sub = abs(num - X)
  if sub < m_s:
    m_s = sub
    ans = num
print(ans)

Fixed code:
nums = input()
m_s = 999
X = 753
for i in range(len(nums)-2):
  num = int(nums[i:i+3])
  sub = abs(num - X)
  if sub < m_s:
    m_s = sub
print(m_s)
Buggy code:
s = input()
x = []
for i in range(len(s)-2):
    print(s[i:i+2]+s[i+2])
    x.append(abs(int(s[i:i+2]+s[i+2])-753))
print(min(x))

Fixed code:
s = input()
x = []
for i in range(len(s)-2):
    # print(s[i:i+2]+s[i+2])
    x.append(abs(int(s[i:i+2]+s[i+2])-753))
print(min(x))
Buggy code:
S = list(input())
ans = 100000
for i in range(len(S)-2):
    ans = min(ans,abs(753-int(''.join(S[i:i+3]))))
for i in range(len(S)-3):
    ans = min(ans,abs(753-int(''.join(S[i:i+4]))))
print(ans)

Fixed code:
S = list(input())
ans = 100000
for i in range(len(S)-2):
    ans = min(ans,abs(753-int(''.join(S[i:i+3]))))
print(ans)
Buggy code:

import numpy as np
S = input()
min_num = 1000000000000000
for i in range(len(S)-2):
    min_num =min(min_num, np.abs(753 - int(S[i:i+2])))
print(min_num)

Fixed code:

import numpy as np
S = input()
min_num = 1000000000000000
for i in range(len(S)-2):
    min_num =min(min_num, np.abs(753 - int(S[i:i+3])))
print(min_num)
Buggy code:
s = input()
ans = 1000000

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

print(ans)

Fixed code:
s = input()
ans = 1000000

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

print(ans)
Buggy code:
S=input()
print(min(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:
import sys
n = input()

_min =sys.maxsize
for i in range(len(n)-2):
    tmp = int(n[i:i+3])
    tmp = abs(753-tmp)
    if tmp < _min:
        _min = tmp

print(tmp)

Fixed code:
import sys
n = input()

_min =sys.maxsize
for i in range(len(n)-2):
    tmp = int(n[i:i+3])
    tmp2 = abs(753-tmp)
    if tmp2 < _min:
        _min = tmp2

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

Fixed code:
S = input()
l = []
for i in range(len(S) - 2):
    num = abs(int(S[i:i+3]) - 753)
    l.append(num)
print(min(l))
Buggy code:
import collections
s = input()
s2 = collections.deque([int(i) for i in s])
mins = []
x = collections.deque(maxlen = 3)
x.append(s2.popleft())
x.append(s2.popleft())
x.append(s2.popleft())
while s2:
        y = 100*x[0]+ 10*x[1] + x[2]
        mins.append(abs(y - 753))
        x.append(s2.popleft())
print(min(mins))
        

Fixed code:
import collections
s = input()
s2 = collections.deque([int(i) for i in s])
mins = []
x = collections.deque(maxlen = 3)
x.append(s2.popleft())
x.append(s2.popleft())
x.append(s2.popleft())
while s2:
        y = 100*x[0]+ 10*x[1] + x[2]
        mins.append(abs(y - 753))
        x.append(s2.popleft())
y = 100*x[0]+ 10*x[1] + x[2]
mins.append(abs(y - 753))
print(min(mins))
Buggy code:
s = [*input()]
ans = 1000
for i in range(len(s)-2):
	x = int(s[i]+s[i+1]+s[i+2])
    if ans > abs(753-x):
      ans = abs(753-x)
print(ans)


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

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

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

Fixed code:
s=input()
n=len(s)
ans=10**10
for i in range(n-2):
  m=int(s[i:i+3])
  ans=min(ans,abs(m-753))
print(ans)
Buggy code:
s = input()
for i in range(len(s)):
  s = input()
dif = list(1000 for i in range(len(s)-2))
for i in range(len(s)-2):
    tmp = s[i:i+3]
    dif[i] = abs(int(tmp)-753)
print(min(dif))
    

Fixed code:
s = input()
dif = list(1000 for i in range(len(s)-2))
for i in range(len(s)-2):
    tmp = s[i:i+3]
    dif[i] = abs(int(tmp)-753)
print(min(dif))
Buggy code:
s = list(input())
# print(''.join(s[0:3]))
A = []
for i in range(0, len(s) - 2):
    A.append(abs(int(''.join(s[i:i+3])) - 753))
for i in range(0, len(s) - 4):
    A.append(abs(int(''.join(s[i:i+4])) - 753))
print(min(A))


Fixed code:
s = list(input())
# print(''.join(s[0:3]))
A = []
for i in range(0, len(s) - 2):
    A.append(abs(int(''.join(s[i:i+3])) - 753))
# for i in range(0, len(s) - 4):
#     A.append(abs(int(''.join(s[i:i+4])) - 753))
print(min(A))
Buggy code:
S = input()
res = 1000
for i in range(len(S)-2):
  X = int(S[i:i+3])
  res = min(res, X)
print(res)

Fixed code:
S = input()
res = 1000
for i in range(len(S)-2):
  X = int(S[i:i+3])
  res = min(res, abs(X - 753))
print(res)
Buggy code:
s = input()
t = len(s)
lis = []
for i in range(t-2):
  lis.append(t[i:i+3])
def f(x):
  return(abs(int(x) - 753))
lis = list(map(f,lis))
print(min(lis))

Fixed code:
s = input()
t = len(s)
lis = []
for i in range(t-2):
  lis.append(s[i:i+3])
def f(x):
  return(abs(int(x) - 753))
lis = list(map(f,lis))
print(min(lis))
Buggy code:
S = input()

ans = 1000000

for i in range(len(S)-2):
    if(abs(753-int(S[i:i+3]) < ans)):
        ans = abs(753-int(S[i:i+3]))

print(ans)

Fixed code:
S = input()

ans = 1000000

for i in range(len(S)-2):
    if(abs(753-int(S[i:i+3])) < ans):
        ans = abs(753-int(S[i:i+3]))

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

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

minx = 1000
for i in range(len(s) - 2):
    x = abs(753 - int(s[i:i+3]))
    if x < minx:
        minx = x

print(x)


Fixed code:
s = input()

minx = 1000
for i in range(len(s) - 2):
    x = abs(753 - int(s[i:i+3]))
    if x < minx:
        minx = x

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

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

d_min = 999

for i in range(L - 2):
    s = S[i:i+3]
    d = abs(int(s) - 753)
    if d < d_min:
        d_min = d

print(d)


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

d_min = 999

for i in range(L - 2):
    s = S[i:i+3]
    d = abs(int(s) - 753)
    if d < d_min:
        d_min = d

print(d_min)
Buggy code:
a=input()
b=753
for i in range(len(a)-2):
  if abs(int(a[i]+a[i+1]+a[i+2])-753)<b:
    b=abs(int(a[i]+a[i+1]+a[i+2]))
print(b)

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

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

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  temp = 0
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    min = abs(comp_num - temp)
    if temp <= min:
      temp = min
  print(min)


      

Fixed code:

if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  min = 10000000000000000
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    tempmin = abs(comp_num - temp)
    
    if tempmin <= min:
      min = tempmin
  print(min)
Buggy code:
x=753
s=input()
ans=10**10
for i in range(len(s)-3):
    if(abs(x-int(s[i:i+3]))<ans):
        ans=abs(x-int(s[i:i+3]))
print(ans)

Fixed code:
x=753
s=input()
ans=10**10
for i in range(len(s)-2):
    if(abs(x-int(s[i:i+3]))<ans):
        ans=abs(x-int(s[i:i+3]))
print(ans)
Buggy code:
n=input()
m=1000
for i in range (len(n)-2):
  k = abs(int(n[i:i+2]) - 753)
  m = min(m,k)
print(m)


Fixed code:
n=input()
m=1000
for i in range (len(n)-2):
  k = abs(int(n[i:i+3]) - 753)
  m = min(m,k)
print(m)
Buggy code:
str_list = list(input())
min = 1000
for i in range(len(list)-2):
  str = str_list[i]+str_list[i+1]+str_list[i+2]
  dif = abs(int(str)-753)
  if dif < min:
    min = dif
print(min)

Fixed code:
str_list = list(input())
min = 1000
for i in range(len(str_list)-2):
  str = str_list[i]+str_list[i+1]+str_list[i+2]
  dif = abs(int(str)-753)
  if dif < min:
    min = dif
print(min)
Buggy code:
S = input()
result = []
for i in range(len(S)-2):
	print(S[i:i+3])
	result.append(abs(753 - int(S[i:i+3])))
print(str(min(result)))


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

min = abs(int(S[0:3]) - 753)

for i in range(1, len(S) - 2):
    min_now = abs(int(S[i:i+3]) - 753)
    if min > min_now:
        min = min_now
print(min_now)


Fixed code:
S = str(input())

min = abs(int(S[0:3]) - 753)

for i in range(1, len(S) - 2):
    min_now = abs(int(S[i:i+3]) - 753)
    if min > min_now:
        min = min_now
print(min)
Buggy code:
S=str(input())
M=len(S)
list=[]
i=0
for i in range(N-2):
  list.append(S[i:i+3])
  i+=1
N=len(list)
new_list=[]
j=0
for j in range(N):
  new_list.append(abs(int(list[j])-753))
print(min(new_list))


Fixed code:
S=str(input())
M=len(S)
list=[]
i=0
for i in range(M-2):
  list.append(S[i:i+3])
  i+=1
N=len(list)
new_list=[]
j=0
for j in range(N):
  new_list.append(abs(int(list[j])-753))
print(min(new_list))
Buggy code:
S = input()
li = list(S)
li_b = []
for i in range(len(li) - 2):
  a = int(li[i])*100 + int(li[i+1])*10 + int(li[i+2])
  b = abs(a - 753)
  li_b.append(b)
print(b)
  

Fixed code:
S = input()
li = list(S)
li_b = []
for i in range(len(li) - 2):
  a = int(li[i])*100 + int(li[i+1])*10 + int(li[i+2])
  b = abs(a - 753)
  li_b.append(b)
print(min(li_b))
Buggy code:
s = input()
r = 1000
j = 0
for i in range(len(s) - 2):
    if abs(int(s[i:i + 3]) - 753) < r:
        r = abs(int(s[i:i + 3]) - 753)
        j = i
print(s[j:j + 3])


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

m = 753
for i in range(len(S)-3):
    tmp = abs(753 - int(S[i:i+3]))
    if tmp < m:
        m = tmp
    
print(m)

Fixed code:
S = input()

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

print(res)


Fixed code:
s=input()
res=1000
for i in range(3,len(s)+1):
    res=min(res,abs(753-int(s[i-3:i])))

print(res)
Buggy code:
s=input()
ss=753
for i in range(0,len(s)-3):
    v=abs(753 - int(s[i:i+3]))
    ss=min([ss,v])
print(ss)

Fixed code:
s=input()
ss=753
for i in range(0,len(s)-1):
    v=abs(753 - int(s[i:i+3]))
    ss=min([ss,v])
print(ss)
Buggy code:
s=list(input())
t=[int(a) for a in s]
n=int(len(t))
ans=0
b=0
list1=[]
s=1000
for i in range(n-2):
    u=[t[i],t[i+1],t[i+2]]
    v="".join(map(str, u))
    w=int(v)-753
    list1.append(w)
u=int(len(list1))
for i in range(u-1):
    if abs(list1[i])-abs(s)<0:
        s=list1[i]
    else :
        pass
print(abs(s))

Fixed code:
s=list(input())
t=[int(a) for a in s]
n=int(len(t))
ans=0
b=0
list1=[]
s=1000
for i in range(n-2):
    u=[t[i],t[i+1],t[i+2]]
    v="".join(map(str, u))
    w=int(v)-753
    list1.append(w)
u=int(len(list1))
for i in range(u):
    if abs(list1[i])-abs(s)<=0:
        s=list1[i]
    else :
        pass
print(abs(s))
Buggy code:
S = input()
num = 753
ans = 999

for i in range(len(S) - 2):
  cur = int(S[i:i + 3])
  if (abs(num - cur) < ans):
	ans = abs(num - cur)
print(ans)
      

Fixed code:
S = input()
num = 753
ans = 999

for i in range(len(S) - 2):
	cur = int(S[i:i + 3])
	if (abs(num - cur) < ans):
		ans = abs(num - cur)
print(ans)
Buggy code:
s = int(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:
s = int(input())
print(min(abs(int(s[i:i+3]-753) for i in range(len(s))))

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

Fixed code:
S = input()
N = len(S)
ans = 999
for i in range(N - 2): 
	num = int(S[i:i+3])
	if ans > abs(num - 753):
		ans = abs(num - 753)
print(ans)
Buggy code:
S = input()
Z = 753
for i in range(3, len(S)+1):
  s = int(S[i-3:i])
  a = abs(753-s)
  if Z-a>0:
    Z = a
print(a)

Fixed code:
S = input()
Z = 753
for i in range(3, len(S)+1):
  s = int(S[i-3:i])
  a = abs(753-s)
  if Z-a>0:
    Z = a
print(Z)
Buggy code:
s = input()

ans = float("inf")
for i in range(len(s)-2):
    num = int(s[i:i+3])
    if abs(754-num) < ans:
        ans = abs(754-num)

print(ans)

Fixed code:
s = input()

ans = float("inf")
for i in range(len(s)-2):
    num = int(s[i:i+3])
    if abs(753-num) < ans:
        ans = abs(753-num)

print(ans)
Buggy code:
li = list(input())
print(li)

min=999

for num in range(len(li)-2):
  value = 100*int(li[num])+10*int(li[num+1])+int(li[num+2])
  print(value)
  if min >= abs(753-value):
    min = abs(753-value)

print(min)

Fixed code:
li = list(input())
 
min=999
 
for num in range(len(li)-2):
  value = 100*int(li[num])+10*int(li[num+1])+int(li[num+2])
  if min >= abs(753-value):
    min = abs(753-value)
 
print(min)
Buggy code:
s = input()
ans = 9999
for i in range(len(s) - 2):
    ans = min(ans, abs(int(s[i: i + 3]) - 753))
    print(s[i: i + 3])
print(ans)

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

Fixed code:
s=input()
n=len(s)
list=[]
for i in range(n-2):
  list.append(''.join(s[i:i+3]))
ans=[]
for l in list:
  ans.append(abs(int(l)-753))
print(min(ans))
Buggy code:
numbers = list(input())
y = 753
result = []
for i in range(len(numbers)-3):
    x = ''.join([int(x) for x in numbers[i:i+3]])
    d = abs(x-y)
    result.append(d)
print(min(result))

Fixed code:
numbers = list(input())
y = 753
result = []
for i in range(len(numbers)-2):
    x = int(''.join(numbers[i:i+3]))
    d = abs(x-y)
    result.append(d)
print(min(result))
Buggy code:

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    s = list(map(int,list(input())))
    n = len(s)
    ans = 1000
    for i in range(n-2):
        ans = min(ans,abs(753-100*s[i]+10*s[i+1]+s[i+2]))
    
    print(ans)

main()


Fixed code:

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    s = list(map(int,list(input())))
    n = len(s)
    ans = 1000
    for i in range(n-2):
        ans = min(ans,abs(753-(100*s[i]+10*s[i+1]+s[i+2])))
    
    print(ans)

main()
Buggy code:
S=input()
ans = 753
for i in range(len(S)-2):
    num = int(S[i]+S[i+1]+S[i+2])
    print(num)
    if ans > abs(753-num):
        ans=abs(753-num)
print(ans)

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

def main():
    X = input()
    mini = 100000

    for index in range(len(X)-3):
        if mini > abs(int(X[index:index+3]) - 753):
            mini = abs(int(X[index:index+3]) - 753)
    print (mini)




if __name__ == '__main__':
    main()


Fixed code:
import math

def main():
    X = input()
    mini = 100000

    for index in range(len(X)-2):
        if mini > abs(int(X[index:index+3]) - 753):
            mini = abs(int(X[index:index+3]) - 753)
    print (mini)




if __name__ == '__main__':
    main()
Buggy code:
s = input()
ans = 753
for i in range(len(s)-2):
  x = int(s[i]+s[i+1]+s[i+2])
  print(x)
  ans = min(ans,abs(753-x))
print(ans)

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

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

s = input()

min = 999
i = 0
while i + 3 < len(s):
    t = s[i:i+3]
    n = int(t) - 753
    if n < 0:
        n = -n
    if min > n:
        min = n
    i = i + 1

print(min)


Fixed code:
# B

s = input()

min = 999
i = 0
while i + 3 <= len(s):
    t = s[i:i+3]
    n = int(t) - 753
    if n < 0:
        n = -n
    if min > n:
        min = n
    i = i + 1

print(min)
Buggy code:
s = list(input())

ans = float('inf')
for i in range(len(s)-3):
    now = sum(t * 10**i for i, t in enumerate(list(map(int, s[i:i+3]))[::-1]))
    ans = min(ans, abs(now - 753))
print(ans)
    

Fixed code:
s = list(input())

ans = float('inf')
for i in range(len(s)-2):
    now = sum(t * 10**i for i, t in enumerate(list(map(int, s[i:i+3]))[::-1]))
    ans = min(ans, abs(now - 753))
print(ans)
Buggy code:
s=input()
ans=1000
l=len(s)
for i in range(l-2):
  if ans>abs(753-s[i:i+3]):
    ans=abs(753-s[i:i+3])
print(ans)

Fixed code:
s=input()
ans=1000
l=len(s)
for i in range(l-2):
  if ans>abs(753-int(s[i:i+3])):
    ans=abs(753-int(s[i:i+3]))
print(ans)
Buggy code:
table = list(map(int, input()))
diff_nagomi = 1000
for i in range(len(table)-2):
    diff = table[i] * 100 + table[i + 1] * 10 + table[i + 2] - 753
    if diff_nagomi > diff:
        ans = diff
print(abs(ans))


Fixed code:
table = list(map(int, input()))
diff_nagomi = 1000
ans = 0
for i in range(len(table)-2):
    diff = abs(table[i] * 100 + table[i + 1] * 10 + table[i + 2] - 753)
    if diff_nagomi > diff:
        ans = diff
        diff_nagomi = diff
print(ans)
Buggy code:
s=input()

n=len(s)

ans=100000
for i in range(n-3):
  t=str(s[i])+str(s[i+1])+str(s[i+2])
  x=abs(753-int(t))
  
  ans=min(ans,x)
  
print(ans)

Fixed code:
s=input()

n=len(s)

ans=100000
for i in range(n-2):
  t=str(s[i])+str(s[i+1])+str(s[i+2])
  x=abs(753-int(t))
  
  ans=min(ans,x)
  
print(ans)
Buggy code:
s = input()
l=[]
for i in range(len(s)-3):
  tmin = abs(int(s[i:i+3])-753)
  l.append(tmin)  
print(min(l))

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

Fixed code:
s = input()
ret = 10000
for i in range(len(s)-2):
  ret= min(ret, abs(int(s[i:i+3])-753))
print(ret)
Buggy code:
import math

S = input()

log = math.floor(math.log10(int(S)))
m = 753
for i in range(0,log-2):
    now = int(S[i] + S[i+1] + S[i+2])
    m = min(m, abs(753-now))

print(m)
    


Fixed code:
import math

S = input()

log = math.floor(math.log10(int(S)))
m = 753
for i in range(0,log-1):
    now = int(S[i] + S[i+1] + S[i+2])
    m = min(m, abs(753-now))

print(m)
Buggy code:
S=input()
ans=1000
for i in range(len(S)-3):
  ans=min(ans,abs(753-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:
S = list(input())

ans = 1000
L = len(S)
for i in range(L):
  if L - 1 < i + 2:
    break
  
  s = int("".join(S[i:i+3]))
  ans = min(ans,753-s)

print(ans)


Fixed code:
S = list(input())

ans = 1000
L = len(S)
for i in range(L):
  if L - 1 < i + 2:
    break
  
  s = int("".join(S[i:i+3]))
  ans = min(ans,abs(753-s))

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

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

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

for i in range(0,S-2):
    n = int(S[i:i+3])
    if diff > abs(753-n):
        diff = abs(753-n)
    
print(diff)

Fixed code:
S = input()
l = len(S)
diff = 999

for i in range(0,l-2):
    n = int(S[i:i+3])
    if diff > abs(753-n):
        diff = abs(753-n)
    
print(diff)
Buggy code:
s = input()
n = len(s)
ans = 10000
for i in range(n-3):
  x = int(s[i:i+3])
  ans = min(ans, abs(753-x))
print(ans)

Fixed code:
s = input()
n = len(s)
ans = 10000
for i in range(n-2):
  x = int(s[i:i+3])
  ans = min(ans, abs(753-x))
print(ans)
Buggy code:
import numpy as np
S=list(input())
U=[]
for i in range(len(S)-2):
    A=int(S[i])*100+int(S[i+1])*10+int(S[i+2])
    U.append(A)
U=np.array(U)
D=U-753
print(max(D))

Fixed code:
import numpy as np
S=list(input())
U=[]
for i in range(len(S)-2):
    A=int(S[i])*100+int(S[i+1])*10+int(S[i+2])
    U.append(A)
U=np.array(U)
D=U-753
print(min(abs(D)))
Buggy code:
s=input()
ans=1000
for i in range(len(s)-3):
  ans=min(ans,abs(753-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:
S = list(str(input()))
 
ans = 0
for i in range(len(S) - 3):
  if abs(753 - int(''.join(S[i:(i+3)]))) < abs(753 - ans):
    ans = int(''.join(S[i:(i+3)]))
print(abs(753 - ans))

Fixed code:
S = list(str(input()))
 
ans = 0
for i in range(len(S) - 2):
  if abs(753 - int(''.join(S[i:(i+3)]))) < abs(753 - ans):
    ans = int(''.join(S[i:(i+3)]))
print(abs(753 - ans))
Buggy code:
n = list(map(int,input()))
c = 1000
for i in range(len(n)-3):
    c = min(abs(n[i]*100+n[i+1]*10+n[i]-753),c)
print(c)

Fixed code:
n = list(map(int,input()))
l = len(n)
c = 1000
for i in range(l-2):
    c = min(abs(n[i]*100+n[i+1]*10+n[i+2]-753),c)
print(c)
Buggy code:
S=input()
ans = 1000
for i in range(len(S)-3):
  diff = abs(int(S[i:i+3]) - 753)
  ans = min(diff, ans)
print(ans)

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

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

ans = 1000
for i in range(len(S)-2):
    print(abs(int(S[i:i+3])- 753))
    t = abs(int(S[i:i+3])- 753)
    if t < ans:
        ans = t
print(ans)

Fixed code:
S = input()

ans = 1000
for i in range(len(S)-2):
    t = abs(int(S[i:i+3])- 753)
    if t < ans:
        ans = t
print(ans)