qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a, b, c = map(int, input().split(' '))

if a + b == c:
    print('Yes')
    return
elif a + c == b:
    print('Yes')
    return
elif b + c == a:
    print('Yes')
    return
else:
    print('No')
    return

Fixed code:
a, b, c = map(int, input().split(' '))

if a + b == c:
    print('Yes')

elif a + c == b:
    print('Yes')

elif b + c == a:
    print('Yes')

else:
    print('No')
Buggy code:
a = list(map,int(input().split()))
a.sort()

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

Fixed code:
a=list(map(int,input().split()))
a.sort()
if a[0]+a[1]==a[2]:
    print('Yes')
else:
    print('No')
Buggy code:
a,b,c=map(int,input().split())
t=a+b+c
k=0 if a+b==c or a+c==b or b+c==a else 0
print(['Yes','No'][k])


Fixed code:
a,b,c=map(int,input().split())
t=a+b+c
k=0 if a+b==c or a+c==b or b+c==a else 1
print(['Yes','No'][k])
Buggy code:
Cnd = list(map(int,input().split()))
Cnd = sorted(Cnd)
result = 'No'
if Cnd[0]=Cnd[1]+Cnd[2]:
	result ='Yes'
id Cnd[0]+Cnd[1]=Cnd[2]:
	result ='Yes'
print(result)

Fixed code:
Cnd = list(map(int,input().split()))
Cnd = sorted(Cnd)
result = 'No'
if Cnd[0]==Cnd[1]+Cnd[2]:
	result ='Yes'
if Cnd[0]+Cnd[1]==Cnd[2]:
	result ='Yes'
print(result)
Buggy code:
abc = sorted(list(int, input().split()))
print("Yes" if abc[0] + abc[1] == abc[2] else "No")

Fixed code:
abc = sorted(list(map(int, input().split())))
print("Yes" if abc[0] + abc[1] == abc[2] else "No")
Buggy code:
a,b,c = map(int,input().split())
sum = a+b+c
half = sum/2
if a == sum or b == sum or c == sum:
	print('Yes')
else:
	print('No')

Fixed code:
a,b,c = map(int,input().split())
sum = a+b+c
half = sum/2
if a == half or b == half or c == half:
	print('Yes')
else:
	print('No')
Buggy code:
n = input().split()
a = int(n[0])
b = int(n[1])
c = int(n[2])
if (a + b) == c:
  print('Yes')
elif (a + b) == c:
  print('Yes')
elif (a + c) == b:
  print('Yes')
else:
  print('No')

Fixed code:
n = input().split()
a = int(n[0])
b = int(n[1])
c = int(n[2])
if (a + b) == c:
  print('Yes')
elif (b + c) == a:
  print('Yes')
elif (a + c) == b:
  print('Yes')
else:
  print('No')
Buggy code:
a,b,c =map(int,input().split(" "))

if a>b:
    if a>c:
        max = a
    else:
        max = c
else:
    if a<b:
        if c<b:
            max = b
        else:
            max = c

if max == a:
    if a== b+c:
        print("Yes")
    else:
        print("No")

if max == b:
    if b== a+c:
        print("Yes")
    else:
        print("No")
        
if max == c:
    if c== b+a:
        print("Yes")
    else:
        print("No")


Fixed code:
a,b,c =map(int,input().split(" "))

if a>b:
    if a>c:
        max = a
    else:
        max = c
else:
    if a<=b:
        if c<b:
            max = b
        else:
            max = c

if max == a:
    if a== b+c:
        print("Yes")
    else:
        print("No")

elif max == b:
    if b== a+c:
        print("Yes")
    else:
        print("No")
        
elif max == c:
    if c== b+a:
        print("Yes")
    else:
        print("No")
Buggy code:
a, b, c = map((int, input().split()))
if (a==b+c) or (b==c+a) or (c==a+b):
    print("Yes")
else:
    print("No")

Fixed code:
a, b, c = map(int, input().split())
if (a==b+c) or (b==c+a) or (c==a+b):
    print("Yes")
else:
    print("No")
Buggy code:
A,B,C = map(int, input().split())

if A+B == C or A+C ==B or B+C == A:
    print('Yec')
else:
    print('No')



Fixed code:
A,B,C = map(int, input().split())

if A+B == C or A+C ==B or B+C == A:
    print('Yes')
else:
    print('No')
Buggy code:
A  = list(map(int,input().split()))

a = sorted(A)

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


  

Fixed code:
A = sorted(list(map(int,input().split())))
print('Yes' if A[0]+A[1]==A[2] else 'No')
Buggy code:
a,b,c=map(int,input().split())
if a+c==b or b+c==a or a==b:
  print("Yes")
else:
  print("No")

Fixed code:
a,b,c=map(int,input().split())
if a+c==b or b+c==a or a+b==c:
  print("Yes")
else:
  print("No")
Buggy code:
a,b,c = map(int,input().split)

if a==b+c:
  print("Yes")
elif b==a+c:
  print("Yes")
elif c==a+b:
  print("Yes")

print("No")
      
        

Fixed code:
a,b,c = map(int,input().split())

if a==b+c:
  print("Yes")
elif b==a+c:
  print("Yes")
elif c==a+b:
  print("Yes")
else:
  print("No")
Buggy code:
a, b, c = sorted(map(int, input()))
if a + b == c:
  print("Yes")
else:
  print("No")

Fixed code:
a, b, c = sorted(map(int, input().split()))
if a + b == c:
  print("Yes")
else:
  print("No")
Buggy code:
a, b, c = map(int,input(),split())
if c == a + b:
    print("Yes")
if b == a + c:
    print("Yes")
if a == b + c:
    print("Yes")
else:
    print("No")

Fixed code:
a, b, c = map(int, input().split())
if a+b==c or a+c==b or b+c==a:
    print("Yes")
else:
    print("No")
Buggy code:
a, b, c = map(int,input().split())
if a==b+c or b==a+c or c==a+b:
   print(Yes)
else:print(No)

Fixed code:
a, b, c = map(int, input().rstrip().split())
if a == b+c or b == a+c or c == a+b:
    print("Yes")
else:
    print("No")
Buggy code:
def MAP(): return map(int, input().split())
x = sorted(MAP(x))
if x[0] + x[1] == x[2]:
  print("Yes")
else:
  print("No")


Fixed code:
def MAP(): return map(int, input().split())
x = sorted(MAP())
if x[0] + x[1] == x[2]:
  print("Yes")
else:
  print("No")
Buggy code:
a, b, c = map(int, input().split)

if a + b == c or b + c == a or c + a == b:
    print('Yes')
    
else:
    print('No')

Fixed code:
a,b,c=map(int,input().split())
print('Yes' if (a+b) == c or (b+c) == a or (a+c) == b else 'No')
Buggy code:
#coding: utf-8

def solve(a, b, c):
  if a == b + c:
    return "Yes"
  elif b == c + a:
    return "Yes"
  elif c == a + b:
    return "Yes"
  return "No"

print(solve(list(map(int, input().split()))))

Fixed code:
#coding: utf-8
 
def solve(a, b, c):
  if a == b + c:
    return "Yes"
  elif b == c + a:
    return "Yes"
  elif c == a + b:
    return "Yes"
  return "No"
 
print(solve(*list(map(int, input().split()))))
Buggy code:
# coding: utf-8
"""Fighting over Candies

@author: hijiri.n
@modified: 11-19-2016

"""


def solve():
    candies = list(map(int, input().split()))
    ach = sum(candies) // 2
    for c in candies:
        if c == ach:
            return "Yes"
    return "No"
 

print(solve_a())


Fixed code:
# coding: utf-8
"""Fighting over Candies

@author: hijiri.n
@modified: 11-19-2016

"""


def solve():

    candies = list(map(int, input().split()))
    ach = sum(candies) / 2

    for c in candies:
        if c == ach:
            return "Yes"
    return "No"
 

print(solve())
Buggy code:
a,b,c=map(int,input().split())
MAX=max[a,b,c]
SUM=sum[a,b,c]
if MAX==SUM-MAX:
  print(Yes)
else:
  print(No)

Fixed code:
a,b,c=map(int,input().split())
l=[a,b,c]
MAX=max(l)
SUM=sum(l)
if MAX==SUM-MAX:
  print("Yes")
else:
  print("No")
Buggy code:
a,b,c=map(int,input())

if a==b+c or b==a+c or c==a+b:
  print("Yes")
  
else:
  print("No")

Fixed code:
a,b,c = map(int,input().split())
if a+b == c or b+c == a or c+a == b:
	print('Yes')
else:
	print('No')
Buggy code:
s=input().split()
p=[0,0,0]
for n in range(3):
    p[n]=int(s[n])
if p[0]+p[1]==p[2]:
    print("Yes")
elif p[1]+p[2]==p[0]:
    print("Yes")
elif p[2]+p[0]==p[1]:
    print("Yes")
else
    print("No")


Fixed code:
s=input().split()
p=[0,0,0]
for n in range(3):
    p[n]=int(s[n])
if p[0]+p[1]==p[2]:
    print("Yes")
elif p[1]+p[2]==p[0]:
    print("Yes")
elif p[2]+p[0]==p[1]:
    print("Yes")
else:
    print("No")
Buggy code:
def solve():
    a, b, c = map(int, input().split())
    if a == b + c:
        ans = "YES"
    elif b == a + c:
        ans = "YES"
    elif c == a + b:
        ans = "Yes"
    else:
        ans = "No"
    print(ans)

if __name__ == '__main__':
    solve()

Fixed code:
def solve():
    a, b, c = map(int, input().split())
    if a == b + c:
        ans = "Yes"
    elif b == a + c:
        ans = "Yes"
    elif c == a + b:
        ans = "Yes"
    else:
        ans = "No"
    print(ans)

if __name__ == '__main__':
    solve()
Buggy code:
candy=sorted(map(int,input().split()))
print("Yes" if candy[0]+candy[1]=candy[2])

Fixed code:
candy= sorted(map(int,input().split()))
print("Yes" if candy[0]+candy[1]== candy[2] else "No")
Buggy code:
a=list(map(int, input().split()))
a.sort()
if a[0]==a[1]+a[2]: print('Yes')
else: print('No')

Fixed code:
a=list(map(int, input().split()))
a.sort()
if a[2]==a[0]+a[1]: print('Yes')
else: print('No')
Buggy code:
a,b,c = map(int,input().split())
if a + b = c or b + c = a or c + a = b:
  print("Yes")
else:
  print("No")

Fixed code:
a,b,c = map(int,input().split())
if a + b == c or b + c == a or c + a == b:
  print("Yes")
else:
  print("No")
Buggy code:
a, b, c = map(int, input().split())
if a == b or b == c or c == a:
    print('Yes')
else:
    print('No')


Fixed code:
a,b,c = map(int,input().split())
print("Yes" if a==b+c or b==c+a or c==a+b else "No")
Buggy code:
a,b,c=map(int,input().split())
if a+b==c || a+c==b || b+c==a:
  print("Yes")
else:
  print("No")

Fixed code:
a,b,c=map(int,input().split())
if a+b==c or c+a==b or b+c==a:
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c=map(int,input().split())

if sum(a,b) == c or sum(a,c) == b or sum(c,b) == a:
    print("Yes")
else:
    print("No")

Fixed code:
a,b,c=map(int,input().split())

if a+b==c or a+c==b or c+b==a:
    print("Yes")
else:
    print("No")
Buggy code:
def main():
    a, b, c = map(int, input().split() )

    if a == b + c | b == c + a | c == a + b:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Fixed code:
def main():
    a, b, c = map(int, input().split() )

    if a == b + c or  b == c + a or c == a + b:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()
Buggy code:
abc = list(map(int, input().split()))
if abc[0]+abc[1] == abc[2]:
  print('Yes')
else:
  print('No')

Fixed code:
abc = list(map(int, input().split()))
abc.sort()
if abc[0]+abc[1] == abc[2]:
  print('Yes')
else:
  print('No')
Buggy code:
a=map(int,input().split())
ans='No'
if 2*max(a)==sum(a):
  ans='Yes'
print(ans)

Fixed code:
a=list(map(int,input().split()))
ans='No'
if 2*max(a)==sum(a):
  ans='Yes'
print(ans)
Buggy code:
a, b, c = map(int, input().split())
ab = a+b
bc = b+c
ca = c+a
flg = False
if ab == c:
    flg = True
if bc == a:
    flg = True
if ca == b:
    flg = True

if flg = True:
    print("Yes")
else:
    print("No")

Fixed code:
a, b, c = map(int, input().split())
ab = a+b
bc = b+c
ca = c+a
flg = False
if ab == c:
    flg = True
if bc == a:
    flg = True
if ca == b:
    flg = True

if flg == True:
    print("Yes")
else:
    print("No")
Buggy code:
a,b,c = map(int, input())
if max(a,b,c) == (a+b+c -max(a,b,c)):
  print("Yes")
else:
  print("No")

Fixed code:
a,b,c = map(int, input().split())
if max(a,b,c) == (a+b+c -max(a,b,c)):
  print("Yes")
else:
  print("No")
Buggy code:
a = [int(i) for i in input().split()] 

b = a.sort

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

Fixed code:
a = [int(i) for i in input().split()] 
a.sort()
c = a[0] + a[1]
if (a[2] == c):
  print("Yes")
else:
  print("No")
Buggy code:
a,b,c=input().split()
if a+b==c or a+c==b or b+c==a :
    print("Yes")
else:
    print("No")

Fixed code:
a, b, c = map(int, input().split())
if a + b == c or a + c == b or b + c == a:
  print('Yes')
else:
  print('No')
Buggy code:
s = str(input())
count = 0

for i in range(len(s)):
    for n in range(len(s) - i):
        if s[i] != s[i + n]:
            count += 1
            break
print(count)


Fixed code:
s = str(input())
count = 0

for i in range(len(s) - 1):
        if s[i] != s[i + 1]:
            count += 1
print(count)
Buggy code:
S = input()

length = len(S)
ans = 0

for i in range(n-1):
  if S[i] != S[i+1]:
    ans += 1

print(ans)

Fixed code:
S = input()

length = len(S)
ans = 0

for i in range(length-1):
  if S[i] != S[i+1]:
    ans += 1

print(ans)
Buggy code:
s=int(input())
cnt=0
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    cnt+=1
print(cnt)

Fixed code:
s=list(input())
cnt=0
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    cnt+=1
print(cnt)
Buggy code:
S=input()
res=0
for i in range(len(S)-1):
  if S[i]!=S[i+1]:
    res+=res
print(res)

Fixed code:
S=input()
res=0
for i in range(len(S)-1):
  if S[i]!=S[i+1]:
    res+=1
print(res)
Buggy code:
s = input()
n = len(s)
ct = 0
if len(set(s)) == 1:
  ans = 0
else:
 for i in range(n-1):
  if s[i] != s[i+1]:
    ans+= 1
print(ans)
  

Fixed code:
s = input()
n = len(s)
ans = 0
if len(set(s)) == 1:
  ans = 0
else:
 for i in range(n-1):
  if s[i] != s[i+1]:
    ans+= 1
print(ans)
Buggy code:
S=input()
print(S)
result=0
for i in range(len(S)-1):
  state=S[i]
  if S[i]!=S[i+1]:
    result+=1
  else:
    pass
print(result)

Fixed code:
S=input()
result=0
for i in range(len(S)-1):
  state=S[i]
  if S[i]!=S[i+1]:
    result+=1
  else:
    pass
print(result)
Buggy code:
S = input()
s = s[0]
ans = 0
for i in S:
    if s != i:
        ans += 1
        s = i
print(ans)

Fixed code:
S = input()
s = S[0]
ans = 0
for i in S:
    if s != i:
        ans += 1
        s = i
print(ans)
Buggy code:
s=input()
now,ans=0,0
while now<n-1:
    if s[now]!=s[now+1]:
        ans+=1
    now+=1
print(ans)

Fixed code:
s=input()
now,ans=0,0
while now<len(s)-1:
    if s[now]!=s[now+1]:
        ans+=1
    now+=1
print(ans)
Buggy code:
S = input()

count = 0
check = S[0]

for i in S[1:]:
    if check != S:
        count+=1
        check = i
        
print(count)

Fixed code:
S = input()
count = 0
check = S[0]

for i in S[1:]:
    if check != i:
        count+=1
        check = i
        
print(count)
Buggy code:
S = input()
s = S[0:1]
ans = 0

for i in range(1,len(S)-1):
    if s != S[i:i+1]:
        ans += 1
        s = S[i:i+1]

print(ans)
    

Fixed code:
s = input()
l = len(s)
ans = 0
for i in range(1, l):
    if s[i] != s[i-1]:
        ans += 1
print(ans)
Buggy code:
b = input()
d = []
isWhite = False
cnt = 0
for i in range(len(b-1)):
  if b[i] != b[i+1]:
    d.append(cnt)
  else:
    cnt+=1

print(len(d))
  
  

Fixed code:
b = input()
d = []
isWhite = False
cnt = 0
for i in range(len(b)-1):
  if b[i] != b[i+1]:
    d.append(cnt)
  else:
    cnt+=1

print(len(d))
Buggy code:
ans = 0
S = input()
for i in range(1,len(S)): if S[i-1] != S[i]: ans += 1
print(ans) 

Fixed code:
# input
S = input()

ans = 0
for i in range(len(S) - 1):
    if S[i + 1] != S[i]:
        ans += 1

print(ans)
Buggy code:
s=input()
a=0
for i in range(1,n):
    if s[i]!=s[i-1]:
        a+=1
print(a)

Fixed code:
s=input()
a=0
for i in range(1,len(s)):
    if s[i]!=s[i-1]:
        a+=1
print(a)
Buggy code:
a=input()
b=0
for i in range(len(a)-1):
  a[i]!=a[i+1]:
    b=b+1
if a[-2]!=a[-1]:
  b=b+1
print(b)

Fixed code:
a=input()
b=0
for i in range(len(a)-1):
  if a[i]!=a[i+1]:
    b=b+1
print(b)
Buggy code:
S = input()
p = S[0]
ans = 0
for i in range(1, len(S)):
  if S[i] != p: ans += 1
print (ans)


Fixed code:
S = input()
p = S[0]
ans = 0
for i in range(1, len(S)):
  if S[i] != p: ans += 1
  p = S[i]
print (ans)
Buggy code:
S = input()
count = 0
temp = S[-1]
for s in S[-2::-1]:
    if s != temp:
        count += 1
    temp = s
print(0 if count == 0 else temp-1)

Fixed code:
S = input()
count = 0
temp = S[-1]
for s in S[-2::-1]:
    if s != temp:
        count += 1
    temp = s
print(0 if count == 0 else count)
Buggy code:
S = input()
List = list(S)
trial = 0
for i in range(1,len(List)):
  if List[i] != List[i-1]:
    trial += 1
print(res)

Fixed code:
S = input()
List = list(S)
trial = 0
for i in range(1,len(List)):
  if List[i] != List[i-1]:
    trial += 1
print(trial)
Buggy code:
S = input()
ans = 0
for i in range(len(S) - 1):
    if S[i] != S[i-1]: ans+=1
print(ans)

Fixed code:
S = input()
ans = 0
for i in range(len(S) - 1):
    if S[i] != S[i+1]: ans+=1
print(ans)
Buggy code:
s = input().strip()

prev = None
ans1, ans2 = 0, 0
for _s in s:
  if prev is None:
    prev = _s
  elif prev != _s:
    ans1 += 1
    prev = _s
prev = None
for _s in s[::-1]:
  if prev is None:
    prev = _s
  elif prev != _s:
    ans1 += 1
    prev = _s
print(min(ans1, ans2))

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

prev = None
ans1, ans2 = 0, 0
for _s in s:
  if prev is None:
    prev = _s
  elif prev != _s:
    ans1 += 1
    prev = _s
prev = None
for _s in s[::-1]:
  if prev is None:
    prev = _s
  elif prev != _s:
    ans2 += 1
    prev = _s
print(min(ans1, ans2))
Buggy code:
S = input()
i = 0
ans = 0
while i < len(S)-1:
  if S[i] == S[i+1]:
    ans += 1
    i += 1
  else:
    i += 1
print(ans)

Fixed code:
S = input()
i = 0
ans = 0
while i < len(S)-1:
  if S[i] != S[i+1]:
    ans += 1
    i += 1
  else:
    i += 1
print(ans)
Buggy code:
S=input()
t=len(S)
ans=0
for i in range(t-1):
 if S[i-1]!=S[i]:
  ans+=1
 else:
  ans+=0
print(ans)
 

Fixed code:
S=input()
t=len(S)
ans=0
for i in range(t-1):
 if S[i]!=S[i+1]:
  ans+=1
 else:
  ans+=0
print(ans)
Buggy code:
s = input()
ans = 0
for i in range(len(s-1)):
  if s[i] != s[i+1]:
    ans += 1
print(ans)

Fixed code:
s = input()
ans = 0
for i in range(len(s)-1):
  if s[i] != s[i+1]:
    ans += 1
print(ans)
Buggy code:
s = list(input())
ans = 0
prestr = s[0]
for id in range(len(s) - 1):
    if prestr == s[id - 1]: continue
    else: 
        ans += 1
        prestr = s[id - 1]
print(ans)


Fixed code:
s = list(input())
ans = 0
prestr = s[0]
for id in range(len(s) - 1):
    if prestr == s[id + 1]: continue
    else: 
        ans += 1
        prestr = s[id + 1]
print(ans)
Buggy code:
s=input()
n=len(s)
count=0
if n==1:
  print(0)
  exit()
iro=s[0]
for i in range(1,n):
  if s[i]==iro:
    count+=1
  iro=s[i]
print(count)


Fixed code:
s=input()
n=len(s)
count=0
if n==1:
  print(0)
  exit()
iro=s[0]
for i in range(1,n):
  now=s[i]
  if now!=iro:
    count+=1
  iro=now
print(count)
Buggy code:
ret=0
s=input()
for i in range(len(s)-1):
  if s[i]==s[i+1]:
    ret+=1
print(ret)

Fixed code:
ret=0
s=input()
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    ret+=1
print(ret)
Buggy code:
S=input()
for i in range(len(S)-1):
  cnt=0
  if S[i]!=S[i+1]:
    cnt+=1
print(cnt)
    

Fixed code:
S=input()
cnt=0
for i in range(len(S)-1):
  if S[i]!=S[i+1]:
    cnt+=1
print(cnt)
Buggy code:
#import
#import math
#import numpy as np
#= int(input())
S = input()
#= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}

s = S[0]

r = 0

for i in range(1, len(S)):
    if s != S[i]:
        r += 1

    s = S[i]

print(res)

Fixed code:
#import
#import math
#import numpy as np
#= int(input())
S = input()
#= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}

s = S[0]

r = 0

for i in range(1, len(S)):
    if s != S[i]:
        r += 1

    s = S[i]

print(r)
Buggy code:
s = input()
w = ""
cnt1 = 0
for x in s[1:]:
	if x != w:
      cnt1 += 1

cnt2 = 0
for x in s[-2::-1]:
	if x != w:
      cnt2 += 1

print(min(cnt1, cnt2))


Fixed code:
s = input()
w = ""
cnt1 = 0
for x in s[1:]:
	if x != w:
		cnt1 += 1
		w = x

cnt2 = 0
for x in s[-2::-1]:
	if x != w:
		cnt2 += 1
		w = x

print(min(cnt1, cnt2))
Buggy code:
s = input()
ans = 0

for i in range(len(s)-1):
  if s[i] != S[i+1]:
    ans += 1

print(ans)

Fixed code:
s=input()
ans=0
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    ans+=1
print(ans)
Buggy code:
s = input()
ans = 0
for i in range(1,n):
    if(s[i]!=s[i-1]):
        ans += 1
print(ans)



Fixed code:
s = input()
ans = 0
for i in range(1,len(s)):
    if(s[i]!=s[i-1]):
        ans += 1
print(ans)
Buggy code:

s=input()

count=0
for i in range(len(s)):
    if s[i]!=s[i+1]: count+=1

print(count)

Fixed code:

s=input()

count=0
for i in range(len(s)-1):
    if s[i]!=s[i+1]: count+=1

print(count)
Buggy code:
a=input()
cnt=0
for i in range(len(a)-1):
  if(a[i]==a[i+1]):
    cnt+=1
print(cmt)

Fixed code:
a=input()
cnt=0
for i in range(len(a)-1):
  if(a[i]!=a[i+1]):
    cnt+=1
print(cnt)
Buggy code:
s = input()

count = 0
for i in range(len(s)):
  now = s[i]
  if now != s[i]:
    count += 1
print(count)

Fixed code:
s = input()
 
count = 0
now = s[0]
for i in range(len(s)):
  if now != s[i]:
    count += 1
    now = s[i]
print(count)
Buggy code:
def _1d_reversi(S: str) -> int:
    n = len(S)
    return sum(s[i] != s[i-1] for i in range(1, n))


if __name__ == "__main__":
    S = input()
    ans = _1d_reversi(S)
    print(ans)


Fixed code:
def _1d_reversi(S: str) -> int:
    n = len(S)
    return sum(S[i] != S[i-1] for i in range(1, n))


if __name__ == "__main__":
    S = input()
    ans = _1d_reversi(S)
    print(ans)
Buggy code:
[print(len(list(i.groupby(input())))-1)for i in[__import__('itertools')]][print(len(list(i.groupby(input())))-1)for i in[__import__('itertools')]]

Fixed code:
[print(len(list(i.groupby(input())))-1) for i in [__import__('itertools')]]
Buggy code:
import sys

input = sys.stdin.readline
S = input()
print(S)
S = S.replace('\n' , '')
tmp = ""
division_count = 0
for s in S:
    if tmp == "":
        tmp = s
        continue
    if tmp == s:
        continue
    else:
        tmp = s
        division_count += 1
print(division_count)


Fixed code:
import sys

input = sys.stdin.readline
S = input()
S = S.replace('\n' , '')
tmp = ""
division_count = 0
for s in S:
    if tmp == "":
        tmp = s
        continue
    if tmp == s:
        continue
    else:
        tmp = s
        division_count += 1
print(division_count)
Buggy code:
S = input()
X = S[0]
ans = 0
while 1:    
    for i in range(S):
        if S[i] != X:
            ans += 1
            X =S[i]
            S = S[i:]
            break
    else:
        break
print(ans)
    


Fixed code:
S = input()
X = S[0]
ans = 0
while 1:    
    for i in range(len(S)):
        if S[i] != X:
            ans += 1
            X =S[i]
            S = S[i:]
            break
    else:
        break
print(ans)
Buggy code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


s = list(input())

cnt = 0

for i in range(len(s)):
    if s[i-1] != s[i]:
        cnt += 1

print(cnt)



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


s = list(input())

cnt = 0

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

print(cnt)
Buggy code:
import sys

s = input()

before = s[0]
ans = 0
for cx in range(1, len(s)):
    if before != s[cx]:
        ans += 1
        before = s[cx]

print(abs)


Fixed code:
import sys

s = input()

before = s[0]
ans = 0
for cx in range(1, len(s)):
    if before != s[cx]:
        ans += 1
        before = s[cx]

print(ans)
Buggy code:
s=input()
ans=0
for i in range(len(s):):
  if s[i]!=s[i+1]:
    ans+=1
print(ans)

Fixed code:



s = input()
now = s[0]
ans = 0

for i in range(1,len(s)):
    if(s[i]!=now):
        ans+=1
        now = s[i]
print(ans)
Buggy code:
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

def calcDivision(s):
  res = 0
  prev = ""
  for i in range(len(s)):
    if s[i] == prev:
      pass
    else:
      if s[i] == "":
        pass
      else:
        res += 1
    prev = s[i]
  return res

# @njit
def solve(s):
  return calcDivision(s)



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()


Fixed code:
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

def calcDivision(s):
  res = 0
  prev = ""
  for i in range(len(s)):
    if s[i] == prev:
      pass
    else:
      if prev == "":
        pass
      else:
        res += 1
    prev = s[i]
  return res

# @njit
def solve(s):
  return calcDivision(s)



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()
Buggy code:
S = input()
ans = 0
for i in range(1,len(S)):
  if S[i-1] != S[i]:
    ans += 1

Fixed code:
S = input()
ans = 0
for i in range(1,len(S)):
  if S[i-1] != S[i]:
    ans += 1
print(ans)
Buggy code:
s=input()
ans=[]
for i in range(len(s)-1):
	if s[i] != s[i+1]:
		ans.append(s[i])
if s[-1] != s[-2]:
	ans.append(s[-1])
print(ans)
print(len(ans)-1)
	

Fixed code:
s=input()
ans=[]
for i in range(len(s)-1):
	if s[i] != s[i+1]:
		ans.append(s[i])
ans.append(s[-1])
print(len(ans)-1)
Buggy code:
s=input()
a=s[0]
ans=0
for i in s[1:]:
  if i!=a:
    ans+=1
    a=1
print(ans)

Fixed code:
s=input()
a=s[0]
ans=0
for i in s[1:]:
  if i!=a:
    ans+=1
    a=i
print(ans)