qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
A= N//1000
B = (N - A*1000) //100
C = (N - A*1000 - B*100) // 10
D = N - A*1000 - B*100 - C*10
if A = B = C:
 print("Yes")
elif B=C=D:
 print("Yes")
else:
 print("No")

Fixed code:
N = int(input())
A= N//1000
B = (N - A*1000) //100
C = (N - A*1000 - B*100) // 10
D = N - A*1000 - B*100 - C*10
if A == B == C:
 print("Yes")
elif B==C==D:
 print("Yes")
else:
 print("No")
Buggy code:
n = input()
if n[0] = n[1] = n[2] or n[1] = n[2] = n[3]:
  print("Yes")
else:
  print("No")

Fixed code:
n = input()
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
  print("Yes")
else:
  print("No")
Buggy code:
s = input()
if(s[0] == s[1]):
    if(s[1] == s[2]):
        print("Yes")
        exit
if(s[1] == s[2]):
    if(s[2] == s[3]):
        print("Yes")
        exit
print("No")


Fixed code:
s = input()
if(s[0] == s[1]):
    if(s[1] == s[2]):
        print("Yes")
        exit()
if(s[1] == s[2]):
    if(s[2] == s[3]):
        print("Yes")
        exit()
print("No")
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""

a = str(input())

char_list = list(a)


if a(0)==a(1):
  if a(1)==a(2):
    print("Yes")
  elif a(1)==a(3)
    print("Yes")
else :
    if a(1)==a(2)==a(3):
      print("Yes")
    else:
      print("No")
      
    
    
    
  
       





Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""

# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""


b =str( input())

a = list(b)



if b[0]==b[1]:
  if b[1]==b[2]:
    print("Yes")
  else :
    print("No")

elif b[1]==b[2]:
  if b[2]==b[3]:
    print("Yes")
  else :
    print("No")
else:
  print("No")
Buggy code:
n = list(input())

for i in range(2):
    if n[i] == n[i+1] == n[i+2]:
        print("Yes")
        break
    else:
        print("No")

Fixed code:
n = list(input())
flg = ""

for i in range(2):
    if n[i] == n[i+1] == n[i+2]:
        flg = "Yes"
        break
    else:
        flg = "No"
        
        
print(flg)
Buggy code:
a = list(map(int,list(input())))
count = 1
check = False
for i in range(len(a)-1):
    if a[i] == a[i+1]:
        count += 1
        if count==3:
            check = True
    else:
        count = 1
print ('yes' if check==True else 'No')

Fixed code:
a = list(map(int,list(input())))
count = 1
check = False
for i in range(len(a)-1):
    if a[i] == a[i+1]:
        count += 1
        if count==3:
            check = True
    else:
        count = 1
print ('Yes' if check==True else 'No')
Buggy code:
n = list(input())
if (list[0] == list[1] and list[1] == list[2]) or (list[1] == list[2] and list[2] == list[3]):
    print('Yes')
else:
    print('No')

Fixed code:
n = input()
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
	print('Yes')
else:
	print('No')
Buggy code:
N = list(str(input()))

pre = ''
num = 0
for n in N:
  if pre == n:
    num +=1
  else:
    num = 0
    pre = n
if num >=3:
  print("Yes")
else:
  print("No")

Fixed code:
N = list(str(input()))

pre = ''
num = 1
for n in N:
  if pre == n:
    num +=1
    if num >=3:
      break
  else:
    num = 1
    pre = n
if num >=3:
  print("Yes")
else:
  print("No")
Buggy code:
n = list(input())
if list[0] == list[1] == list[2] or list[1] == list[2] == list[3]:
    print('Yes')
else:
    print('No')

Fixed code:
n = input()
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    ans = "Yes"
else:
    ans = "No"
print(ans)
Buggy code:
n = str(input(()))

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print("Yes")
else:
    print("No") 

Fixed code:
n = str(input())

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print("Yes")
else:
    print("No")
Buggy code:
a = input()
if len(set(list(a[0:3]))) == 1 or len(set(list(a[1:4]))) = 1:
  print("Yes")
else:
  print("No")

Fixed code:
a = input()
if len(set(a[0:3])) == 1 or len(set(a[1:4])) == 1:
    print("Yes")
else:
    print("No")
Buggy code:
#coding:utf-8

n = list(input())

if s[0] == s[1] and s[1] == s[2]:
  print('Yes')
elif s[1] == s[2] and s[2] == s[3]:
  print('Yes')
elif s[0] == s[1] and s[1] == s[2] and s[2] == s[3]:
  print('Yes')
else:
  print('No')

Fixed code:
#coding:utf-8

n = list(input())

if n[0] == n[1] and n[1] == n[2]:
  print('Yes')
elif n[1] == n[2] and n[2] == n[3]:
  print('Yes')
elif n[0] == n[1] and n[1] == n[2] and n[2] == n[3]:
  print('Yes')
else:
  print('No')
Buggy code:
n = input()

if n[0] and n[1] and n[2] or n[1] and n[2] and n[3]:
    print ("Yes")
else:
    print ("No")

Fixed code:
n = input()

if (n[0] == n[1] == n[2]) or (n[1] == n[2] == n[3]):
    print ("Yes")
else:
    print ("No")
Buggy code:
a = str(input())
if a[0] = a[1] = a[2] or a[1] = a[2] = a[3]:
    print("Yes")
else:
    print("No")

Fixed code:
a = str(input())
if a[0] == a[1] == a[2] or a[1] == a[2] == a[3]:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
a = [int(c) for c in s]
  if a[0] == a[1] and a[1]== a[2]:
    print("Yes")
  elif a[1] == a[2] and a[2] == a[3]:
    print("Yes")
  else:
    print("No")

Fixed code:
s = input()
a = [int(c) for c in s]
if a[0] == a[1] and a[1]== a[2]:
    print("Yes")
elif a[1] == a[2] and a[2] == a[3]:
    print("Yes")
else:
    print("No")
Buggy code:
num = input()

if num[:3].count(num[0])==3 or num[1:].count(num[1]):
  print("Yes")
else: print("No")

Fixed code:
num = input()
if num[:3].count(num[0])==3 or num[1:].count(num[1])==3:
  print("Yes")
else: print("No")
Buggy code:
N = input()

if N[1] == N[2] and (N[0] == N[1] or N[2] == N[3]):
    print( 'Yes' )
else:
    print( 'Yes' ) 

Fixed code:
N = input()

if N[1] == N[2] and (N[0] == N[1] or N[2] == N[3]):
    print( 'Yes' )
else:
    print( 'No' )
Buggy code:
nums = [int(n) for n in input()]
for i in range(2):
  if set(nums[i:i+3:]) == 1:
    print('Yes')
    break
else:
  print('No')

Fixed code:
nums = [int(n) for n in input()]
for i in range(2):
  if len(set(nums[i:i+3:])) == 1:
      print('Yes')
      break
else:
    print('No')
Buggy code:
def main():
    N = input()
    c_list = [c for c in N]
    if((c[0] == c[1] and c[0] == c[2]) or (c[1] == c[2] and c[1] == c[3])):
        print("Yes")
    else:
        print("No")

main()

Fixed code:
def main():
    N = input()
    c = [c for c in N]
    if((c[0] == c[1] and c[0] == c[2]) or (c[1] == c[2] and c[1] == c[3])):
        print("Yes")
    else:
        print("No")

main()
Buggy code:
 = input()
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print("Yes")
else:
    print("No")

Fixed code:
N = input()
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print("Yes")
else:
    print("No")
Buggy code:
n = input()

search_list = [str(x) * 3 for x in range(1,10)]
for i in search_list:
    if i in n:
        print('Yes')
        break
else:
    print(No)

Fixed code:
n = input()
search_list = [str(x) * 3 for x in range(0,10)]
for i in search_list:
    if i in n:
        print('Yes')
        break
else:
    print("No")
Buggy code:
n = int(input())

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print('Yes')
else:
    print('No')


Fixed code:
n = input()

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print('Yes')
else:
    print('No')
Buggy code:
n=int(input())
a=0
for i in range(2):
  if n[i]==n[i+1] and n[i+1]==n[i+2]:
    a=1
print(["No","Yes"][a])

Fixed code:
n=input()
a=0
for i in range(2):
  if n[i]==n[i+1] and n[i+1]==n[i+2]:
    a=1
print(["No","Yes"][a])
Buggy code:
N = input()
left = len(set(list(N[1:]))) == 1
right = len(set(list(N[:3]))) == 1
print("Yes" if left or right "No")

Fixed code:
N = input()
left = len(set(list(N[1:]))) == 1
right = len(set(list(N[:3]))) == 1
print("Yes" if left or right else "No")
Buggy code:
a = list(input())
if ((a[0] == a[1]) and (a[1] == a[2])) or ((a[1] == a[2]) and (a[2] == a[3]))
	print("Yes")
else:
	print("No") 

Fixed code:
a=input()
if a[1]==a[2]==a[3] or a[0]==a[1]==a[2]:
  print('Yes')
else:
  print('No')
Buggy code:
#-*- coding: utf-8 -*-
N = str(input())
  if N[0]==N[1]==N[2] or N[1]==N[2]==N[3]:
    print("Yes")
  else:
    print("No")

Fixed code:
#-*- coding: utf-8 -*-
N = str(input())
if N[0]==N[1]==N[2] or N[1]==N[2]==N[3]:
  print("Yes")
else:
  print("No")
Buggy code:
n = input()
if n[0] == n[1]:
    if n[0] == n[2] or n[0] == n[3]:
        print("Yes")
    else:
        print("No")
else:
    if n{1} != n[2]:
        print("No")
    else:
        print("Yes")


Fixed code:
n = input()
if n[0] == n[1]:
    if n[0] == n[2]:
        print("Yes")
    else:
        print("No")
else:
    if n[1] != n[2] or n[1] != n[3]:
        print("No")
    else:        
        print("Yes")
Buggy code:
n = list(input())
s = n[0:3]
e = n[1:4]
if len(set(s))==1 or len(set(e)):
	print('Yes')
else:
	print('No')

Fixed code:
n = list(input())
s = n[0:3]
e = n[1:4]
if len(set(s))==1 or len(set(e))==1:
	print('Yes')
else:
	print('No')
Buggy code:
N = input()
if N[0] == N[1] == N[2] == N[3] :
  print('Yes')
else:
  print('No')

Fixed code:
N = input()

if(N[0] == N[1] == N[2] or N[1] == N[2] == N[3]):
  print("Yes")
else:
  print("No")
Buggy code:
n=input()
if (n[0]==n[1] and n[1]=n[2]) or (n[1]==n[2] and n[2]==n[3]):
  print('Yes')
else:
  print('No')

Fixed code:
n=input()
if (n[0]==n[1] and n[1]==n[2]) or (n[1]==n[2] and n[2]==n[3]):
  print('Yes')
else:
  print('No')
Buggy code:
n=int(input())
if n/10%111==0 or n%1000%111==0:
 print("Yes")
else:
 print("No")

Fixed code:
n=int(input())
if n//10%111==0 or n%1000%111==0:
  print("Yes")
else:
  print("No")
Buggy code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = input()
if len(set(n[0:3])) == 1 or len(set(n[1:4])):
    print('Yes')
else:
    print('No')

    

Fixed code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = input()
if len(set(n[0:3])) == 1 or len(set(n[1:4])) == 1:
    print('Yes')
else:
    print('No')
Buggy code:
n = int(input())

if (n[0] == [1] and n[1] == n[2]) or (n[1] == n[2] and n[2] == n[3]) or (n[3] == n[0] and n[0] == [1]):
  print("Yes")
else:
  print("No")

Fixed code:
n = input()
if n[0] == n[1] and n[1] == n[2] or n[1] == n[2] and n[2] == n[3]:
    print('Yes')
else:
    print('No')
Buggy code:
n = input()
 
if (n[0] == n[1] == n[2] or (n[1] == n[2] == n[3]):
  print("Yes")
else:
  print("No")

Fixed code:
n = input()
print('Yes' if n[0] == n[1] == n[2] or n[1] == n[2] == n[3] else 'No')
Buggy code:
n = input()
 
if ((n[0] == [1] and n[1] == n[2]) or (n[1] == n[2] and n[2] == n[3]) or (n[3] == n[0] and n[0] == [1])):
  print("Yes")
else:
  print("No")

Fixed code:
n = list(input())
print("Yes" if n[1] == n[2] and (n[0] == n[1] or n[2] == n[3]) else "No")
Buggy code:
# -*- coding: utf-8 -*-
N = map(str, input().split())
out = "No"
N_list = list(N)
if N_list[0]==N_list[1] and N_list[0]==N_list[2]:
    out = "Yes"
elif N_list[1]==N_list[2] and N_list[1]==N_list[3]:
    out = "Yes"

print(out)

Fixed code:
# -*- coding: utf-8 -*-
N = str, input()
out = "No"
N_list = list(N[1])

if N_list[0]==N_list[1] and N_list[0]==N_list[2]:
    out = "Yes"
elif N_list[1]==N_list[2] and N_list[1]==N_list[3]:
    out = "Yes"

print(out)
Buggy code:
a = input()
print("Yes" if a[1]==a[2]==a[0] or a[1]==a[2]==a[3], else "No")

Fixed code:
a = input()
print("Yes" if a[0]==a[1]==a[2] or a[1]==a[2]==a[3] else "No")
Buggy code:
n=input()
count = 0
for i in range(0,2):
    if n[i] == n[i+1]:
        count = count + 1
        print(count)
if count >= 2:
    print("Yes")
else:print("No")


Fixed code:
n=input()
count = 0
for i in range(0,2):
    if n[i] == n[i+1] == n[i+2]:
        count = count + 1
if count >= 1:
    print("Yes")
else:print("No")
Buggy code:
n = input()

if (n[0]==n[1] and n[1]==n[2]) or (n[3]==n[2] and n[1]==n[2]):
  print("Yes")
else:
  print("NO")

Fixed code:
n = input()

if n[1]==n[2] and (n[3]==n[2] or n[1]==n[0]):
  print("Yes")
else:
  print("No")
Buggy code:
n = input()

if (n[0]==n[1] and n[1]==n[2]):
  print("Yes")
elif (n[3]==n[2] and n[1]==n[2]):
  print("Yes")
else:
  print("NO")

Fixed code:
n=input()
if n[0]==n[1] and n[1]==n[2]:
  print("Yes")
elif n[1]==n[2] and n[3]==n[2]:
  print("Yes")
else:
  print("No")
Buggy code:
n=input()
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print(Yes)
else:
  print(No)


Fixed code:
n = input()
if n[1]==n[2]:
	if n[0]==n[1] or n[2]==n[3]:
		print("Yes")
	else:
		print("No")
else: print("No")
Buggy code:
N = input()

print(N)

if N[0] == N[1] and N[1] == N[2]:
    print('Yes')
elif N[1] == N[2] and N[2] == N[3]:
    print('Yes')
else:
    print('No')

Fixed code:
N=input()

if N[0]==N[1] and N[1]==N[2]:
    print('Yes')
elif N[1]==N[2] and N[2]==N[3]:
    print('Yes')
else:
    print('No')
Buggy code:
n = list(input())
if ((len(collections.Counter(n[:3])) == 1) | (len(collections.Counter(n[1:])) == 1)):
    print("Yes")
else:
    print("No")

Fixed code:
import collections
n = list(input())
if ((len(collections.Counter(n[:3])) == 1) | (len(collections.Counter(n[1:])) == 1)):
    print("Yes")
else:
    print("No")
Buggy code:
n = input()

if int(n[1:]) % 111 == 0 or int(n[:-1]) % 111 == 0:
  print("Yes")
else:
  print("NO")

Fixed code:
n = input()

if int(n[1:]) % 111 == 0 or int(n[:-1]) % 111 == 0:
  print("Yes")
else:
  print("No")
Buggy code:
N = input()
if len(set(N[0:2])) == 1 or len(set(N[1:3])):
  print("Yes")
else:
  print("No")

Fixed code:
N = input()

if len(set(N[0:3])) == 1 or len(set(N[1:])) == 1:
    print('Yes')
else:
    print('No')
Buggy code:
# input
N = [int(x) for x in list(input()]

if N[1] == N[2]:
    if N[0] == N[1] or N[2] == N[3]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Fixed code:
# input
N = [int(x) for x in list(input())]

if N[1] == N[2]:
    if N[0] == N[1] or N[2] == N[3]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Buggy code:
s = int(input())
if s[0]==s[1]==s[2] or s[1]==s[2]==s[3]:
  print('Yes')
else:
  print('No')

Fixed code:
s = str(input())
if s[0]==s[1]==s[2] or s[1]==s[2]==s[3]:
  print('Yes')
else:
  print('No')
Buggy code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

a = list(input())

print(a)

if a[0] == a[1] and a[1] == a[2]:
    print("Yes")

elif a[0] == a[1] and a[1] == a[3]:
    print("Yes")

elif a[0] == a[2] and a[2] == a[3]:
    print("Yes")

elif a[2] == a[1] and a[1] == a[3]:
    print("Yes")

else:
    print("No")

Fixed code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

a = list(input())


if (a[0] == a[1]) and (a[1] == a[2]):
    print("Yes")


elif (a[2] == a[1]) and (a[1] == a[3]):
    print("Yes")

else:
    print("No")
Buggy code:
#79a
n=input().split()
if n[0]==n[1] and n[1]==n[2] :
    print('Yes')
elif n[1]==n[2] and n[2]==n[3] :
    print('Yes')
else:
    print('No')

Fixed code:
#79a
n=input()
if n[0]==n[1] and n[1]==n[2] :
    print('Yes')
elif n[1]==n[2] and n[2]==n[3] :
    print('Yes')
else:
    print('No')
Buggy code:
s = input()

if s[0] == s[1] == s[2] or s[1] == s[2] == s[3]
    print('Yes')
else:
    print('No')

Fixed code:
s = input()
if s[0] == s[1] == s[2] or s[1] == s[2] == s[3]:
	print('Yes')
else:
	print('No')
Buggy code:
print("Yes" if (N[0]==N[1]==N[2])or(N[1]==N[2]==N[3]) else "No" )

Fixed code:
N=input()
print("Yes" if (N[0]==N[1]==N[2])or(N[1]==N[2]==N[3]) else "No" )
Buggy code:
N=input()
answer="No"
for i in range(len(N)-2)
  if N[i]==N[i+1]:
    if N[i+1]==N[i+2]:
      answer="Yes"
print(answer)

Fixed code:
N=input()
answer="No"
for i in range(len(N)-2):
  if N[i]==N[i+1]:
    if N[i+1]==N[i+2]:
      answer="Yes"
print(answer)
Buggy code:
N = int(input())
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
  print("Yes")
else:
  print("No")


Fixed code:
N = input()

if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print('Yes')
else:
    print('No')
Buggy code:
n = input()
print('Yes' if len(set(n[:3])) == 1 or len(set(n[1:4])) == 1 'No')

Fixed code:
n = input()
print('Yes' if len(set(n[:3])) == 1 or len(set(n[1:4])) == 1 else 'No')
Buggy code:
N = int(input())

if N[0] == N[1] and N[1] == N[2]:
    print("Yes")
elif N[2] == N[1] and N[3] == N[2]:
    print("Yes")
else:
    print("No")

Fixed code:
N = input()

if N[0] == N[1] and N[1] == N[2]:
    print("Yes")
elif N[2] == N[1] and N[3] == N[2]:
    print("Yes")
else:
    print("No")
Buggy code:
N = input()
if int(N[0:4]) % 111 == 0 or int(N[1:4]) % 111 == 0:
  print("Yes")
else:
  print("No")


Fixed code:
N = input()
if int(N[0:3]) % 111 == 0 or int(N[1:4]) % 111 == 0:
  print("Yes")
else:
  print("No")
Buggy code:
print('Yes' if len(set(input()[:3]))==1 or len(set(input()[1:]))==1 else 'No')

Fixed code:
n = input()
if len(set(n[1:]))==1 or len(set(n[:3]))==1:
  print("Yes")
else:
  print("No")
Buggy code:
n = input()
print('Yes' if len(set(list(n[:3]))) == 1 or len(set(list(n[1:4]))) == 1 'No')

Fixed code:
n = list(input())
if len(set(n)) == 1 or len(set(n[:3])) == 1 or len(set(n[1:])) == 1:
    print("Yes")
else:
    print("No")
Buggy code:
S = input()
cnt = 0
prev = S[0]
for c in S[1:]:
  if c == prev:
    cnt += 1
  else:
    cnt = 0
  if cnt > 2:
    print('Yes')
    exit()
  prev = c
print('No')

Fixed code:
S = input()
cnt = 1
prev = S[0]
for c in S[1:]:
  if c == prev:
    cnt += 1
  else:
    cnt = 1
  if cnt > 2:
    print('Yes')
    exit()
  prev = c
print('No')
Buggy code:
n = int(input())
if n[0] == n[1] and n[1] == n[2]:
  print('Yes')
elif n[1] == n[2] and n[2] == n[3]:
  print('Yes')
else:
  print('No')

Fixed code:
n = input()

if (n[0] == n[1]) and (n[1] == n[2]):
  print('Yes')
elif (n[1] == n[2]) and (n[2] == n[3]):
  print('Yes')
else:
  print('No')
Buggy code:
a = list(map(int, input()))
 
if a[1] == a[2] and a[1] == a[0] or a[1] == a[3]:
    print("Yes")
else:
    print("no")


Fixed code:
a = list(map(int, input()))
 
if a[1] == a[2] and (a[1] == a[0] or a[1] == a[3]):
    print("Yes")
else:
    print("No")
Buggy code:
N = list(map(int, input()))
ans = 'N'
if N[0] == N[1] and N[0] == N[2]:
    ans = 'Y'¥
elif N[1] == N[2] and N[1] == N[3]:
    ans = 'Y'

if ans == 'Y':
    print('Yes')
else:
    print('No')

Fixed code:
N = list(map(int, input()))
ans = 'N'
if N[0] == N[1] and N[0] == N[2]:
    ans = 'Y'
elif N[1] == N[2] and N[1] == N[3]:
    ans = 'Y'

if ans == 'Y':
    print('Yes')
else:
    print('No')
Buggy code:
a = int(input())

if a[0]==a[1]==a[2] or a[1]==a[2]==a[3] a[0]==a[1]==a[2]==a[3]:
  print('Yes')
else:
  print('No')

Fixed code:
a = str(input())
 
if a[0]==a[1]==a[2] or a[1]==a[2]==a[3] or a[0]==a[1]==a[2]==a[3]:
  print('Yes')
else:
  print('No')
Buggy code:
n = input()
print("No" if ((n//10) % 111 and (n%1000) % 111) else "Yes")

Fixed code:
n = int(input())
print("No" if ((n//10) % 111 and (n%1000) % 111) else "Yes")
Buggy code:
N = input()
if len(set(N[1:]) == 1 or len(set(N[:3])) == 1:
  print("Yes")
else
  print("No")


Fixed code:
N = input()
if len(set(N[1:])) == 1 or len(set(N[:3])) == 1:
  print("Yes")
else:
  print("No")
Buggy code:
s = input()
if (s[0]==s[1] and s[1]==s[2]) and (s[1]==s[2] and s[2]==s[3]):
    print("Yes")
else:
    print("No")

Fixed code:
s = input()
if (s[0]==s[1] and s[1]==s[2]) or (s[1]==s[2] and s[2]==s[3]):
    print("Yes")
else:
    print("No")
Buggy code:
keta = list(input())
if (keta[0] == [1] and keta[1] == [2]) or (keta[1] == [2] and keta[2] == [3]):
    print("Yes")
else:
    print("No")

Fixed code:
n = list(input())
if n[1]==n[2] and (n[0]==n[1] or n[2]==n[3]):
  print('Yes')
else:
  print('No')
Buggy code:
n = int(input())
for i in range(2):
    if n[i] == n[i+1] and n[i+1] == n[i+2]:
        print("Yes")
        exit()
print("No")

Fixed code:
n = input()
for i in range(2):
    if n[i] == n[i+1] and n[i+1] == n[i+2]:
        print("Yes")
        exit()
print("No")
Buggy code:
N = list(input())
print('Yes' if N[1] == N[2] and (N[0] == N[1] or N[2] == N[3]) else 'No')a

Fixed code:
N = list(input())
print('Yes' if N[1] == N[2] and (N[0] == N[1] or N[2] == N[3]) else 'No')
Buggy code:
n = int(input())

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
  print('Yes')
else:
  print('No')

Fixed code:
N = input()
if int(N[0]) == int(N[1]) == int(N[2]) or int(N[1]) == int(N[2]) == int(N[3]):
    print("Yes")
else:
    print("No")
Buggy code:
s = input()

for i in range(len(s)-2):
  if s[i]==s[i+1] and s[i]==s[i+2]:
    print("Yes")
    break
  else:
    print("No")

Fixed code:
s = input()

for i in range(len(s)-2):
  if s[i]==s[i+1] and s[i]==s[i+2]:
    ans="Yes"
    break
  else:
    ans="No"
print(ans)
Buggy code:
n = list(input())
print("Yes" if min(len(set(n[:3])), len(set(n[1:])) == 1 else "No")

Fixed code:
n = list(input())
print("Yes" if min(len(set(n[:3])), len(set(n[1:]))) == 1 else "No")
Buggy code:
N=input()
ans=1
for i in range(len(N)-1):
  if N[i] == N[i+1]:
    ans+=1
  else:
    ans=1
if ans>=3: print("Yes")
else: print("No")

Fixed code:
N=input()
ans=1
for i in range(len(N)-1):
  if N[i] == N[i+1]:
    ans+=1
  else:
    ans=1
  if ans>=3: 
    print("Yes")
    exit()
print("No")
Buggy code:
s = list(input())

def calc(i, a, b,tag):
  a ,b = int(a), int(b)
  if i==0:
    c = a+b
    tag.append('+')
  elif i==1:
    c = a-b
    tag.append('-')
  return c, tag
    
for i in range(2):
  tag = []
  c ,tag= calc(i,s[0],s[1],tag)
  for j in range(2):
    d ,tag = calc(j,c,s[2],tag)
    for k in range(2):
      e ,tag = calc(k,d,s[3],tag)
      if e == 7:
        print(s[0]+tag[0]+s[1]+tag[1]+s[2]+tag[2]+s[3])
        exit()


Fixed code:
s = list(input())

def calc(i, a, b):
  a ,b = int(a), int(b)
  if i==0:
    c = a+b
  elif i==1:
    c = a-b
  return c
 
def tag(t_list):
  t = []
  for p in t_list:
    if p==0:
        t.append('+')
    else:
        t.append('-')
  return(t)
    
for i in range(2):
  c = calc(i,s[0],s[1])
  for j in range(2):
    d = calc(j,c,s[2])
    for k in range(2):
      e = calc(k,d,s[3])
      if e == 7:
        t_list = [i,j,k]
        t = tag(t_list)
        print(s[0]+t[0]+s[1]+t[1]+s[2]+t[2]+s[3]+'=7')
        exit()
Buggy code:
def dfs(N, ops, nums, Sum):
    if N == 3:
        if Sum == 7:
            print(str(nums[0])+ops[0]+str(nums[1])+ops[1]+str(nums[2])+ops[2]+str(nums[3]))
            return True
        else:
            return False
    else:
        ops[N]="+"
        if dfs(N+1, ops, nums, Sum+nums[N+1]):
            return True
        ops[N]="-"
        if dfs(N+1, ops, nums, Sum-nums[N+1]):
            return True

nums=[int(i) for i in input()]
ops=["" for i in range(3)]
dfs(0, ops, nums, nums[0])

Fixed code:
def dfs(N, ops, nums, Sum):
    if N == 3:
        if Sum == 7:
            print(str(nums[0])+ops[0]+str(nums[1])+ops[1]+str(nums[2])+ops[2]+str(nums[3])+"=7")
            return True
        else:
            return False
    else:
        ops[N]="+"
        if dfs(N+1, ops, nums, Sum+nums[N+1]):
            return True
        ops[N]="-"
        if dfs(N+1, ops, nums, Sum-nums[N+1]):
            return True

nums=[int(i) for i in input()]
ops=["" for i in range(3)]
dfs(0, ops, nums, nums[0])
Buggy code:

def a(s,i):
    if i = l-1:
        if eval(s)==7:
            return s
    return a(s+"+"+N[i],i+1) + a(s+"-"+N[i],i+1)

N = input()
l = len(N)

print(a(N[0],0) + "=7")

Fixed code:
def a(s,i):
    if i == l-1:
        if eval(s)==7:
            print(s+"=7")
            exit()
        return
    a(s+"+"+N[i+1],i+1)
    a(s+"-"+N[i+1],i+1)

N = input()
l = len(N)

a(N[0],0)
Buggy code:

def a(s,i):
    if i = l-1:
        if eval(s)==7:
            print(s+"=7")
            exit()
        return
    a(s+"+"+N[i],i+1)
    a(s+"-"+N[i],i+1)

N = input()
l = len(N)

a(N[0],0)

Fixed code:
def seven(s,i):
    if i==l-1:
        if eval(s)==7:
            print(s+"=7")
            exit()
        return
    seven(s+"+"+N[i+1],i+1)
    seven(s+"-"+N[i+1],i+1)
        
N = input()
l=len(N)
seven(N[0],0)