qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a=input()
if a[0]==a[1]==a[3] or a[1]==a[2]==a[3] or a[0]==a[1]==a[2]==a[3]:
  print("Yes")
else:
  print("No")

Fixed 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")
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] 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())
a=n//1000
n=n%1000
b=n//100
n=n%100
c=n//10
d=n%10
if b==c and (a==b or c==d):
  print("Yes")
else:
  print("No")

Fixed code:
n = int(input())
d = n // 1000
c = n % 1000 // 100
b = n % 100 // 10
a = n % 10
if (a == b and b == c) or (b == c and c == d):
    print ('Yes')
else:
    print ('No')
Buggy code:
n = list(input())
print(n)
if n[1] != n[2]:
  print('No')
elif n[0] == n[1] or n[2] == n[3]:
  print('Yes')
else:
  print('No')

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

x=input(int)
x=str(x)

if x[0]==x[1]:
    if x[1]==x[2]:
        print("Yes")
    elif x[1]!=x[2]:
        print("No")
elif x[0]!=x[1]:
    if x[1]==x[2]:
        if x[2]==x[3]:
            print("Yes")
        elif x[2]!=x[3]:
            print("No")
    elif x[1]!=x[2]:
        print("No")
    
    

Fixed code:

x=str(input())

if x[0]==x[1]:
    if x[1]==x[2]:
        print("Yes")
    elif x[1]!=x[2]:
        print("No")
elif x[0]!=x[1]:
    if x[1]==x[2]:
        if x[2]==x[3]:
            print("Yes")
        elif x[2]!=x[3]:
            print("No")
    elif x[1]!=x[2]:
        print("No")
Buggy code:
l=list(input())
print("Yes" if len(set(l))<=2 and len(set(l[:3]))==1 or len(set(l[1:])) else "No")

Fixed code:
l=list(input())
print("Yes" if len(set(l))<=2 and len(set(l[:3]))==1 or len(set(l[1:]))==1 else "No")
Buggy code:
N=input();print('Yes')if set(N[:3])==1or set(N[1:])==1else print('No')

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

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:
n = list(str(input()))
if n[0]==n[1]==n[2] or n[2]==n[1]==n[3]
    print("Yes")
else:
    print("No")


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

if N[0] == N[1] and 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:
from sys import stdin

def main():
    n = stdin.readline()
    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:
        prinnt("No")

if __name__ == '__main__':
    main()

Fixed code:
from sys import stdin

def main():
    n = stdin.readline()
    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")

if __name__ == '__main__':
    main()
Buggy code:
N = int(input())
a = list(N)
if N[0]==N[1]==N[2]==N[3] or N[0]==N[1]==N[2] or N[1]==N[2]==N[3]:
    print('Yes')
else:
    print('No')


Fixed code:
N = input()
a = list(N)
if N[0]==N[1]==N[2]==N[3] or N[0]==N[1]==N[2] or N[1]==N[2]==N[3]:
    print('Yes')
else:
    print('No')
Buggy code:
N = input()
num = "0"
count = 1
for i in N:
	if (num == i):
		count += 1
	elif count > 2:
		break
	else:
		count = 1
	num = i
	print(num, count)
if count > 2:
	print("Yes")
else:
	print("No")

Fixed code:
N = input()
num = "0"
count = 1
for i in N:
	if (num == i):
		count += 1
	elif count > 2:
		break
	else:
		count = 1
	num = i

if count > 2:
	print("Yes")
else:
	print("No")
Buggy code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    # 1 line 1 int
    return int(sys.stdin.readline().rstrip())
def LI():
    # 1 line n ints
    return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    # 1 line 1 string
    return sys.stdin.readline().rstrip()
def LS():
    # 1 line n strings
    return list(sys.stdin.readline().rstrip().split())

A = S()

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




Fixed code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    # 1 line 1 int
    return int(sys.stdin.readline().rstrip())
def LI():
    # 1 line n ints
    return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    # 1 line 1 string
    return sys.stdin.readline().rstrip()
def LS():
    # 1 line n strings
    return list(sys.stdin.readline().rstrip().split())

A = S()

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

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:
N=input()
list=[a for a in N]
if list.count(list[0])==3 or list.count(list[1])==3 or list.count(list[2])==3 or list.count(list[3])==3:
    print('Yes')
else:
    print('No')
    

Fixed code:
N=input()
list=[a for a in N]
if list[0]==list[1]==list[2] or list[1]==list[2]==list[3]:
    print('Yes')
else:
    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 = str(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()
res = S[0]
ans = 0
for i in range(1,len(S)):
  if S[i] == res:
    ans += 1
    res = S[i]
  else:
    ans = 0
    res = S[i]
if ans == 3:
  print('Yes')
else:
  print('No')

Fixed code:
S = input()
res = S[0]
ans = 1
for i in range(1,len(S)):
  if S[i] == res:
    ans += 1
    res = S[i]
    if ans == 3:
      print('Yes')
      exit()
  else:
    ans = 1
    res = S[i]

print('No')
Buggy code:
x = [int(i) for i in input()]
x.sort()
print(x)
if x[0]==x[1]==x[2] or x[1]==x[2]==x[3]:
  print("Yes")
else:
  print("No")

Fixed code:
x = [int(i) for i in input()]

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

Fixed code:
s = input()
print('Yes' if len(set(s[:3])) == 1 or len(set(s[1:])) == 1 else '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:
n = str(input())
flag = False

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

Fixed code:
n = str(input())
flag = False

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    flag = True

if flag:
    print('Yes')
else:
    print('No')
Buggy code:
n=int(input())
a=n//1000
b=n//100-a*10
d=n%10
c=n%100-d
if a==b and b==c:
    print("Yes")
elif b==c and c==d:
    print("Yes")
else:
    print("No")


Fixed code:
n=int(input())
a=n//1000
b=(n//100)-(a*10)
d=n%10
c=((n%100)-d)//10
if a==b and b==c:
    print("Yes")
elif b==c and c==d:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
#dummy = set(s)
#print(dummy,s[0],s[2])
ans = s[0]
count = 0
for i in s:
  if i == ans:
    count += 1
  else:
    count = 0
  ans = i
if count <= 2:
  print("No")
else:
  print("Yes")



Fixed code:
s = input()
#dummy = set(s)
#print(dummy,s[0],s[2])
ans = s[0]
count = 0
for i in s:
  if i == ans:
    count += 1
    if count == 3:
      print("Yes")
      break
  else:
    count = 1
  ans = i
if count <= 2:
  print("No")
Buggy code:
n = input()
n1 = n[:3]
n2 = n[1:]
print('Yes' if (len(set(n1)) == 3 or len(set(n2)) == 3) else 'No')

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

Fixed code:
A=input()
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:
import sys

sys.setrecursionlimit(1000000)


def main():
    s = input()

    ls = ["111", "222", "333", "444", "555", "666", "777", "888", "999"]
    for x in ls:
        if x in ls:
            print("Yes")
            return
    print("No")


main()


Fixed code:
import sys

sys.setrecursionlimit(1000000)


def main():
    s = input()

    ls = ["000", "111", "222", "333", "444", "555", "666", "777", "888", "999"]
    for x in ls:
        if x in s:
            print("Yes")
            return
    print("No")


main()
Buggy code:

N=input()
l=[]
f1=False
f2=False
f3=False
n=-1
for i in N:
    print(i)
    if n==-1 or n!=int(i):
        #print('piu')
        f1=True
        f2=False
        f3=False
        n=int(i)
    elif n==int(i) and f1 and not f2:
        #print('poi')
        f2=True
    elif n==int(i) and f2:
        print('Yes')
        exit(0)
print('No')



Fixed code:

N=input()
l=[]
f1=False
f2=False
f3=False
n=-1
for i in N:
    #print(i)
    if n==-1 or n!=int(i):
        #print('piu')
        f1=True
        f2=False
        f3=False
        n=int(i)
    elif n==int(i) and f1 and not f2:
        #print('poi')
        f2=True
    elif n==int(i) and f2:
        print('Yes')
        exit(0)
print('No')
Buggy code:
N  = input()
if N[0]==N[1]==N[2] and N[0]!=N[3]:
    print('Yes')
elif N[0]!= N[3] and N[1]==N[2]==N[3]:
    print('Yes')
elif N[0]==N[1]==N[2]!=N[3]:
    print('Yes')
else :
    print('No')
    

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

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

import sys
M=input()
 
for i in range(10):
  if(M.find(str(i))!=-1):
    print("Yes")
    sys.exit()
print("No")


Fixed code:
import sys
M=input()
 
for i in range(10):
  if(M.find(str(i)*3)!=-1):
    print("Yes")
    sys.exit()
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()
cue = 0
if n[1] == n[2]:
    if n[0] == n[1] or n[3] == n[2]:
        cue = 1

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

Fixed code:
n = input()
print("Yes" if n[0]==n[1]==n[2]==n[3] or n[0]==n[1]==n[2] or n[1]==n[2]==n[3] else "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:
a=input()
if a[0]==a[1] and a[1]==a[2] || a[1]==a[2] and a[2]==a[3]:
  print("Yes")
else:
  print("No")

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


Fixed code:
n = input()
list = list(n)
if list[0] == list[1] == list[2] or list[1] == list[2] == list[3]:
    print("Yes")
else:
    print("No")
Buggy code:
str = input()
a = int(str[1:])
b = int(str[-1:])
print("Yes") if a % 111 == 0 or b % 111 == 0 else print("No")


Fixed code:
str = input()
a = int(str[:3])
b = int(str[-3:])
print("Yes") if a % 111 == 0 or b % 111 == 0 else print("No")
Buggy code:
N = input()
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()
len = len(N)
cnt = 1
for i in range(0, len, 1):
    cnt = 1
    for j in range(i + 1, len, 1):
        if (N[i] != N[j]):
            break
        else:
            cnt += 1
    num = max(num, cnt)
print("Yes" if 3 <= num else "No")

Fixed code:
N = list(input())
len = len(N)
num = 0
for i in range(0, len, 1):
    cnt = 1
    for j in range(i + 1, len, 1):
        if (N[i] != N[j]):
            break
        else:
            cnt += 1
    num = max(num, cnt)
print("Yes" if 3 <= num else "No")
Buggy code:
import sys

line = sys.stdin.readline().strip()



def is_good(x):
    for c in "1234567890":
        return (c*3) in x
    return False

if is_good(line):
    print("Yes")
else:
    print("No")


Fixed code:
import sys

line = sys.stdin.readline().strip()



def is_good(x):
    for c in "1234567890":
        if (c*3) in x:
            return True
    return False

if is_good(line):
    print("Yes")
else:
    print("No")
Buggy code:
N = input()
a = list(N[:3])
b = list(N[1:4])
if set(a) == 1 or set(b):
    print("Yes")
else:
    print("No")


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

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

if s[0]==s[1]==s[2] or s[1]==s[2]==s[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:
import sys
input = sys.stdin.readline
N = list(input())[: -1]
r = 1
for i in range(len(N) - 1):
  if N[i] == N[i + 1]:
    r += 1
  else: r = 1
if r >= 3: print("Yes")
else: print("No")

Fixed code:
import sys
input = sys.stdin.readline
N = list(input())[: -1]
r = 1
for i in range(len(N) - 1):
  if N[i] == N[i + 1]:
    r += 1
  elif i != 2: r = 1
if r >= 3: print("Yes")
else: print("No")
Buggy code:
n=input()
print("Yes" if n[1]==n[2] and n.count(n[1])==3 else "No")

Fixed code:
n=input()
print("Yes" if n[1]==n[2] and n.count(n[1])>=3 else "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:
# -*- coding: utf-8 -*-

def main():
    l = [e for e in input()]
    cnt = 0
    last = ''
    for c in l:
        print(c, last)
        if c == last:
            cnt+=1
        else:
            cnt = 0
        if cnt == 2:
            print("Yes")
            break
        last = c
    else:
        print("No")

main()


Fixed code:
# -*- coding: utf-8 -*-

def main():
    l = [e for e in input()]
    cnt = 0
    last = ''
    for c in l:
        if c == last:
            cnt+=1
        else:
            cnt = 0
        if cnt == 2:
            print("Yes")
            break
        last = c
    else:
        print("No")

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

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

integer = list(map(int, str(input())))

for i in range(10):
  if integer[0:2] == [i, i, i] or integer[1:3] == [i, i, i]:
    print("Yes")
    sys.exit()

print("No")


Fixed code:
import sys

integer = list(map(int, str(input())))

for i in range(10):
  if integer[0:3] == [i, i, i] or integer[1:4] == [i, i, i] or integer[0:4] == [i, i, i, i]:
    print("Yes")
    sys.exit()

print("No")
Buggy code:
n=str(input())
if n[1]==n[2]==n[3] or n[2]==n[3]==n[4]:
  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:
N = input()

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

Fixed code:
S = input()

if S[0] == S[1] == S[2]:
    print("Yes")
elif S[1] == S[2] == S[3]:
    print("Yes")
else:
    print("No")
Buggy code:
n=str(input())
a=set(n)
p=0
if len(a)==1:
  p=1
elif len(a)==2:
  b=n[0]
  if b==n[1]:
    if b==n[2] or b==n[3]:
        p=1
  elif b==n[2] and b==n[3]:
      p=1
if p=1:
    print('Yes')
else:
    print('No')


Fixed code:
n=str(input())
a=set(n)
p=0
if len(a)==1:
  p=1
elif len(a)==2:
  b=n[0]
  if b==n[1] and b==n[2]:
      p=1
  b=n[1]
  if b==n[2] and b==n[3]:
      p=1
if p==1:
    print('Yes')
else:
    print('No')
Buggy code:
N = input()

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


Fixed code:
N = input()
if N[0] == N[1] == N[2] or N[1] == N[2] == N[3] or N[0] == N[1] == N[2] == N[3]:
    print("Yes")
else:
    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')
elif N[2] == N[3] and N[3]== N[4]:
    print ('Yes')
elif N[0] == N[1] and 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=input();print('NYoe s'[len(set(n))==1 or (len(set(n))==2 and n[1]==n[2] and n[0]!=n[2])::2])

Fixed code:
n=input();print('NYoe s'[len(set(n))==1 or (len(set(n))==2 and n[1]==n[2] and n[0]!=n[3])::2])
Buggy code:
N=list(int(input()))
if N[1]==N[2]:
    if N[1]==N[0]:
        print('Yes')
    elif N[2]==N[3]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Fixed code:
N=list(input())
if N[1]==N[2]:
    if N[1]==N[0]:
        print('Yes')
    elif N[2]==N[3]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Buggy 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')

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 = input()

before = -1
count = 1
for s in N:
    if before == -1:
        before = s
    else:
        if before == s:
            count += 1
        else:
            count = 1
            before = s
print("Yes" if count >= 3 else "No")

Fixed code:
N = input()

before = ""
count = 1
for s in N:
    if before == -1:
        before = s
    else:
        if before == s:
            count += 1
            if count >= 3:
                print("Yes")
                exit()
        else:
            before = s
            count = 1
print("No")
Buggy code:
a=list(input())
if a[0]=a[1]=a[2] or a[1]=a[2]=a[3]:
    print("Yes")
else:
    print("No")

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

Fixed code:
n = list(input())

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
  print('Yes')
else:
  print('No')
Buggy code:
from sys import stdin

s = stdin.readline().rstrip()

ma = 0
point = 1
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        point += 1
    else:
        ma = max(point,ma)
        point = 1
if ma <= 2:
    print("Nn")
else:
    print("Yes")

Fixed code:
from sys import stdin

s = stdin.readline().rstrip()

ma = 0
point = 1
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        point += 1
    else:
        ma = max(point,ma)
        point = 1

ma = max(point,ma)
if ma <= 2:
    print("No")
else:
    print("Yes")
Buggy code:
n = int(input())
if n[1] == n[2] and n[0] == [1] or n[1] == n[2] and 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()
ans = "No"
if s[0] == S[1] == s[2]:
  ans = "Yes"
elif s[1] == s[2] == s[3]:
  ans = "Yes"
print(ans)

Fixed code:
s = input()
ans = "No"
if s[0] == s[1] == s[2]:
  ans = "Yes"
elif s[1] == s[2] == s[3]:
  ans = "Yes"
print(ans)
Buggy code:
S = input()
cnt = 0
temp = S[0]
for s in S:
    if s == temp:
        cnt += 1
    else:
        cnt = 0
        temp = s
    if s >= 3:
        print("Yes")
        exit()
print("No")
        

Fixed code:
S = input()
cnt = 0
temp = S[0]
for s in S[1:]:
    if s == temp:
        cnt += 1
    else:
        cnt = 0
        temp = s
    if cnt >= 2:
        print("Yes")
        exit()
print("No")
Buggy code:
n = int(input())
if n[1] == n[2]:
    if n[0] == n[1] or n[2] == n[3]:
        print('Yes')
        exit()
print('No')

Fixed code:
n = input()
if n[1] == n[2]:
    if n[0] == n[1] or n[2] == n[3]:
        print("Yes")
        exit()
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] 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 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:
def main():
	S = input()
	if (S[0] == S[1] and S[1] == S[2]) or (S[2] == S[1] and S[3] == S[2]):
		print("Yes")
	else:
		printf("No")
if __name__ == '__main__':
    main()

Fixed code:
def main():
	S = input()
	if (S[0] == S[1] and S[1] == S[2]) or (S[2] == S[1] and S[3] == S[2]):
		print("Yes")
	else:
		print("No")
if __name__ == '__main__':
    main()
Buggy code:
n = input()
cnt = 1
valid = False

for a, b in zip(n[1:], n):
    if a != b:
        if cnt >= 3:
            valid = True
            break
        else:
            cnt = 1
    else:
        cnt += 1
if valid is True:
    print("Yes")
else:
    print("No")


Fixed code:
n = input()
cnt = 1
valid = False

for a, b in zip(n[1:], n):
    if a != b:
        if cnt >= 3:
            break
        else:
            cnt = 1
    else:
        cnt += 1
if cnt >= 3:
    valid = True
if valid is True:
    print("Yes")
else:
    print("No")
Buggy code:
a = int(input())

result = False
h1 = -1;
h2 = -1;
while a > 0:
    print(a%10)
    print(h1)
    print(h2)
    result = result or (h1 == h2 and h1 == a%10)
    h2 = h1
    h1 = a%10


    a = a//10;

if result:
    print("Yes")
else:
    print("No")

Fixed code:
a = int(input())

result = False
h1 = -1;
h2 = -1;
while a > 0:
    result = result or (h1 == h2 and h1 == a%10)
    h2 = h1
    h1 = a%10


    a = a//10;

if result:
    print("Yes")
else:
    print("No")
Buggy code:
S = 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)
else:
  print("No")

Fixed code:
S = 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")
else:
    print("No")
Buggy code:
N = input()
if N[0] == N[1] == N[2] and N[1] == N[2] == N[3]:
  print("Yes")
else:
  print("No")


Fixed code:
N = list(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:
a = list(input())
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:
a = list(input())
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:
#79
n=list(input())
if (n[0]n[1]n[2] or n[0]n[2]n[3] or n[0]n[1]n[3] or n[1]n[2]n[3]):
    print('Yes')
else:
    print('No')

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