qyliang/CodeNanoFix huggingface dataset:
Buggy code:
s = input()

l = ["A","C","G","T"]
res = 0

for i in range(len(s)):
    #print(i)
    tmp = 0
    print(s[i:])
    for j in s[i:]:
        if j in l:
            tmp += 1
        else:
            res = max(res,tmp)
            #print(res)
            break
    else:
        res = max(res,tmp)
else:
    print(res)


Fixed code:
s = input()

l = ["A","C","G","T"]
res = 0

for i in range(len(s)):
    #print(i)
    tmp = 0
    #print(s[i:])
    for j in s[i:]:
        if j in l:
            tmp += 1
        else:
            res = max(res,tmp)
            #print(res)
            break
    else:
        res = max(res,tmp)
else:
    print(res)
Buggy code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    strings = input()
    answers=[]
    counter=0

    for string in strings:
        if "A" in string or "C" in string or "G" in string or "T" in string:
            counter+=1
        else:
            answers.append(counter)
            counter=0
    print(max(answers))

Fixed code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    strings = input()
    answers=[]
    counter=0

    for string in strings:
        if "A" in string or "C" in string or "G" in string or "T" in string:
            counter+=1
        else:
            answers.append(counter)
            counter=0
    print(max(answers))


if __name__=="__main__":
    main()
Buggy code:
S = input()
N = len(S)
ans = 0
for i in range(N):
	for j in range(i, N):
		if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
ans = max(ans, j - i + 1)
print(ans)

Fixed code:
S = input()
N = len(S)
ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
            ans = max(ans, j - i + 1)
print(ans)
Buggy code:
S=input()

m_len=0
len=0

acgt={'A','C','G','T'}

for i in S:
    if i in acgt:
        len+=1
        #print(i,len)
    else:
        #print(i,len,m_len)
        if len>m_len:
            m_len=len
        len=0
        
len>m_len
m_len=len

print(m_len)

Fixed code:

S=input()

m_len=0
len=0

acgt={'A','C','G','T'}

for i in S:
    if i in acgt:
        len+=1
        #print(i,len)
    else:
        #print(i,len,m_len)
        if len>m_len:
            m_len=len
        len=0
        
if len>m_len:
    m_len=len

print(m_len)
Buggy code:
D = ["A","T","G","C"]
S = input().strip()
N = len(S)
for k in range(N):
    for i in range(k+1):
        ind = 1
        for j in range(i,i+N-k):
            if S[j] not in D:
                ind = 0
                break
        if ind == 1:
            cnt = N-k
            break
    if ind==1:break
print(cnt)

Fixed code:
D = ["A","T","G","C"]
S = input().strip()
N = len(S)
cnt = 0
for k in range(N):
    for i in range(k+1):
        ind = 1
        for j in range(i,i+N-k):
            if S[j] not in D:
                ind = 0
                break
        if ind == 1:
            cnt = N-k
            break
    if ind==1:break
print(cnt)
Buggy code:
s = input()

atgc = 'ATGC'
count= 0
max_count = 0

for i in range(len(s)):
    if s[i] in atgc:
        print(s[i])
        count += 1
    else:
        if max_count < count:
            max_count = count
        count = 0
if max_count < count:
    max_count = count
print(max_count)

Fixed code:
s = input()

atgc = 'ATGC'
count= 0
max_count = 0

for i in range(len(s)):
    if s[i] in atgc:
        count += 1
    else:
        count = 0
    if max_count < count:
            max_count = count
print(max_count)
Buggy code:
wlist = list(input())
wlength = 0

for w in wlist:
    if not w in ["A","T","G","C"]:
        tmp = 0
        continue

    else:
        tmp += 1
        if tmp >= wlength:
            wlength = tmp
print(wlength)




Fixed code:
wlist = list(input())
wlength = 0
tmp = 0
for w in wlist:
    if not w in ["A","T","G","C"]:
        tmp = 0
        continue

    else:
        tmp += 1
        if tmp >= wlength:
            wlength = tmp
print(wlength)
Buggy code:
s = list(input())
a = ""
ans = 0
for c in s:
    if c in ("A", "C", "G", "T"):
        ans += 1
        a += c
    else:
        ans = max(ans, len(a))
        a = ""
print(ans)


Fixed code:
s = list(input())
a = ""
ans = 0
for c in s:
    if c in ("A", "C", "G", "T"):
        a += c
    else:
        ans = max(ans, len(a))
        a = ""
print(max(ans, len(a)))
Buggy code:
ans = 0
count = 0


for i in S:
    if i =="A" or i == "C" or i == "T" or i == "G":
        count += 1
    else:
        ans = max(count, ans)
        count = 0
        
ans = max(count, ans)
print(ans)

Fixed code:
S = input()
ans = 0
count = 0


for i in S:
    if i =="A" or i == "C" or i == "T" or i == "G":
        count += 1
    else:
        ans = max(count, ans)
        count = 0
        
ans = max(count, ans)
print(ans)
Buggy code:
s=input()
a=0
A=[]
for i in range(len(s)):
    if s[i]=='A' or s[i]=='T' or s[i]=='G' or s[i]=='C':
        a+=1
        A.append(a)
    else:
        a=0
print(max(A))


Fixed code:
s=input()
a=0
A=[0]
for i in range(len(s)):
    if s[i]=='A' or s[i]=='T' or s[i]=='G' or s[i]=='C':
        a+=1
        A.append(a)
    else:
        a=0
print(max(A))
Buggy code:
import re
s = input()
m = re.findall(r"([ACGT]+)", s)
print(max(m, key=len) if m else 0)


Fixed code:
import re
s = input()
m = re.findall(r"([ACGT]+)", s)
print(len(max(m, key=len)) if m else 0)
Buggy code:
ans = 0
ans_tmp = 0
s = input()
for i in range(len(s)):
    ans_tmp = 0
    for s_bubun in s[i:]:
        if s_bubun in ("A","T","G","C"):
            ans_tmp +=1
        else:
            break
    ans = max(ans_tmp,ans)
    print(ans)
print(ans)

Fixed code:
ans = 0
ans_tmp = 0
s = input()
for i in range(len(s)):
    ans_tmp = 0
    for s_bubun in s[i:]:
        if s_bubun in ("A","T","G","C"):
            ans_tmp +=1
        else:
            break
    ans = max(ans_tmp,ans)
print(ans)
Buggy code:
a=input()
b=0
c=0
for i in range(len(a)):
  if a[i]=="A" or a[i]=="C" or a[i]=="G" or a[i]=="T":
    b=b+1
  if a[i]!="A" and a[i]!="C" or a[i]!="G" or a[i]!="T":
    b=0
  if c<b:
    c=b
print(c)

Fixed code:
a=input()
b=0
c=0
for i in range(len(a)):
  if a[i]=="A" or a[i]=="C" or a[i]=="G" or a[i]=="T":
    b=b+1
    if c<b:
      c=b
  if a[i]!="A" and a[i]!="C" and a[i]!="G" and a[i]!="T":
    b=0
print(c)
Buggy code:
S = return sys.stdin.readline().rstrip()
ans,temp = 0,0
for x in S:
    if x in 'ACGT':
        temp += 1
        ans = max(ans,temp)
    else:
        temp = 0
print(ans)


Fixed code:
import sys
def S(): return sys.stdin.readline().rstrip()
S = S()
ans,temp = 0,0
for x in S:
    if x in 'ACGT':
        temp += 1
        ans = max(ans,temp)
    else:
        temp = 0
print(ans)
Buggy code:
#B
s = input()
n = len(s)
for i in range(n):
    for j in range(i,n):
        if all('ACGT'.count(c) == 1 for c in s[i:j+1]):
            ans = max(ans, j - i + 1)
print(ans)

Fixed code:
#B
s = input()
n = len(s)
ans = 0
for i in range(n):
    for j in range(i,n):
        if all('ACGT'.count(c) == 1 for c in s[i:j+1]):
            ans = max(ans, j - i + 1)
print(ans)
Buggy code:
s = input()
count = 0
max_count = 0
for c in s:
  if c in ['A','C','D','T']:
    count = 0
  else:
    count += 1
    if max_count < count:
      max_count = count
print(max_count)

Fixed code:
s = input()
count = 0
max_count = 0
for c in s:
  if c in ['A','C','G','T']:
    count += 1
    if max_count < count:
      max_count = count
  else:
    count = 0
print(max_count)
Buggy code:
s=input()+"O"
tmp=""
ans=[]
for i in s:
  if i in ["A","T","G","C"]:
    tmp=tmp+i
  else:
    ans.append(tmp)
    tmp=""
res=""
for i in ans:
  if len(i)>len(res):
    res=i
print(res)


Fixed code:
s=input()+"O"
tmp=""
ans=[]
for i in s:
  if i in ["A","T","G","C"]:
    tmp=tmp+i
  else:
    ans.append(tmp)
    tmp=""
res=0
for i in ans:
  if len(i)>res:
    res=len(i)
print(res)
Buggy code:
s=input()
n=len(s)
ans=0
for i in range(n):
  for j in range(i,n):
    if all(["ACGT",count(c) == 1 for c in s[i:j+1]]):
      ans=max(ans,j+1-i)
print(ans)

Fixed code:
s=input()
n=len(s)
ans=0
for i in range(n):
  for j in range(i,n):
    if all(["ACGT".count(c) == 1 for c in s[i:j+1]]):
      ans=max(ans,j+1-i)
print(ans)
Buggy code:
s = input()

ans=0
base = set(['A','C','G','T'])
i = 1
while i <= len(s):
    j = 0
    while j+i <= len(s):
        print (i,j,i+j)
        word = set(s[j:j+i])
        print (word)
        if word <= base:
            ans = len(s[j:j+i])
        j += 1
    i += 1
print(ans)

Fixed code:
s = input()

ans=0
base = set(['A','C','G','T'])
i = 1
while i <= len(s):
    j = 0
    while j+i <= len(s):
        word = set(s[j:j+i])
        if word <= base:
            ans = len(s[j:j+i])
        j += 1
    i += 1
print (ans)
Buggy code:
l=input()

if "A" or "G" or "C" or "T" not in l:
  print(0)
  exit()

ans=0
num=0
for i in l:
  print(i)
  if i=="A" or i=="G" or i=="C" or i=="T":
    num+=1
  else:
    ans=max(num,ans)
    num=0
    
print(ans)
    

Fixed code:
l=input()

ans=0
num=0

for i in l:
  if i=="A" or i=="G" or i=="C" or i=="T":
    num+=1
  else:
    ans=max(num,ans)
    num=0
ans=max(ans,num)
    
print(ans)
Buggy code:
s = input()
candidate = 0


def length(s, i, j):
    for c in s[i:j + 1]:
        if c not in 'ACGT':
            return 0
    return len(s[i:j])


for i in range(len(s)):
    for j in range(len(s)):
        candidate = max(candidate, length(s, i, j))

print(candidate)


Fixed code:
s = input()


def length(s, i, j):
    for c in s[i:j + 1]:
        if c not in 'ACGT':
            return 0
    return len(s[i:j + 1])


def find(s):
    candidate = 0
    for i in range(len(s)):
        for j in range(len(s)):
            candidate = max(candidate, length(s, i, j))

    return candidate


print(find(s))
Buggy code:
s=input()
ans=[]
I=[0]*len(s)
for i in range(len(s)):
    if (s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C"):
        I[i]=1

    else:
        I[i]=0
for i in range(I):
    if (I[i]==1 and I[i-1]==0) or (I[i]==1 and i==0):
        ans.append(1)
    elif (I[i]==1 and I[i-1]==1):
        ans[-1]+=1
print(max(ans))


Fixed code:
s=input()
ans=[]
I=[0]*len(s)
for i in range(len(s)):
    if (s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C"):
        I[i]=1

    else:
        I[i]=0
for i in range(len(I)):
    if (I[i]==1 and I[i-1]==0) or (I[i]==1 and i==0):
        ans.append(1)
    elif (I[i]==1 and I[i-1]==1):
        ans[-1]+=1
if ans==[]:
    print(0)
else:
    print(max(ans))
Buggy code:
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(1,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j])-set(S) == set():
        count = max(count,j-i-1)
        
print(count)

Fixed code:
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(0,len(S)):
    for j in range(i+1, len(S)+1):
      if set(S[i:j])-P == set():
        count = max(count,j-i)
        
print(count)
Buggy code:
s = input()

acgt = set("ACGT")

ans = 0

for i in range(len(s)):
    l = 0
    for j in range(i, len(s)):
        print(s[j])
        if s[j] in acgt:
            l += 1
        else:
            ans = max(ans, l)
            break
ans = max(ans, l)
print(ans)


Fixed code:
s = input()

acgt = set("ACGT")

ans = 0

for i in range(len(s)):
    l = 0
    for j in range(i, len(s)):
        if s[j] in acgt:
            l += 1
            if j == len(s)-1:
                ans = max(ans, l)
        else:
            ans = max(ans, l)
            break

print(ans)
Buggy code:
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = []
if len(S) == 1:
    if S in ACGT:
        print(1)
    else:
        print(0)
else:
    for i in range(len(S)):
        j = 0
        while i + j < len(S):
            if S[i + j] in ACGT:
                j += 1
            else:
                ans.append(S[i : i + j])
                break
        if i + j == len(S):
            ans.append(S)
    
    print(max([len(x) for x in ans]))

Fixed code:
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = []
if len(S) == 1:
    if S in ACGT:
        print(1)
    else:
        print(0)
else:
    for i in range(len(S)):
        j = 0
        while i + j < len(S):
            if S[i + j] in ACGT:
                j += 1
            else:
                ans.append(S[i : i + j])
                break
        if i + j == len(S):
            ans.append(S[i : len(S)])
    
    print(max([len(x) for x in ans]))
Buggy code:
s = input()

st = 'ACGT'
ans = 0
cur = 0
for x in s:
  if x in st:
    cur += 1
  else:
    cur = 0
  ans = max(cur, ans)

Fixed code:
s = input()

st = 'ACGT'
ans = 0
cur = 0
for x in s:
  if x in st:
    cur += 1
  else:
    cur = 0
  ans = max(cur, ans)
print(ans)
Buggy code:
s = list(x for x in input())
temp = 0
ans = []
for i in s:
  if i == 'A' or i == 'C' or i =='G' or i =='T':
    temp += 1
    if i == len(s-1):
      ans.append(temp)
  else:
    ans.append(temp)
    temp = 0
print(max(ans))


Fixed code:
s = list(x for x in input())
temp = 0
ans = []
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'C' or s[i] =='G' or s[i] =='T':
    temp += 1
    if i == len(s) - 1:
      ans.append(temp)
  else:
    ans.append(temp)
    temp = 0
print(max(ans))
Buggy code:
import sys

input = sys.stdin.readline

s = list(input().rstrip())

lis = ['A', 'C', 'G', 'T']

for i in range(len(s)):
    for j in range(4):
        if (s[i] == lis[j]):
            s[i] = '!'
            break

print(s)
ct = 0
ct_lis = []

for i, x in enumerate(s):
    print(ct_lis)
    if (x == '!'):
        ct += 1
    else:
        ct_lis.append(ct)
        ct = 0

ct_lis.append(ct)

print(max(ct_lis))


Fixed code:
import sys

input = sys.stdin.readline

s = list(input().rstrip())

lis = ['A', 'C', 'G', 'T']

for i in range(len(s)):
    for j in range(4):
        if (s[i] == lis[j]):
            s[i] = 'AYATASO'
            break

ct = 0
ct_lis = []

for i, x in enumerate(s):
    if (x == 'AYATASO'):
        ct += 1
    else:
        ct_lis.append(ct)
        ct = 0

ct_lis.append(ct)

print(max(ct_lis))
Buggy code:
S = input().strip()
popa = list("ACGT")
maxx = 0
counter = 0
for i in S:
  if i in popa:
    counter+=1
  else:
    maxx = max(maxx,counter)
maxx = max(maxx,counter)
print(maxx)

Fixed code:
S = input().strip()
popa = list("ACGT")
maxx = 0
counter = 0
for i in S:
  if i in popa:
    counter+=1
  else:
    maxx = max(maxx,counter)
    counter = 0
maxx = max(maxx,counter)
print(maxx)
Buggy code:
S=input()
ans=0
cnt=0
for s in S:
    if s in S:
        if s in "ATCG":cnt+=1
        ans=max(ans,cnt)
print(ans)

Fixed code:
S=input()
ans=0
cnt=0
for s in S:
    if s in "ATCG":cnt+=1
    else:cnt=0
    ans=max(ans,cnt)
print(ans)
Buggy code:

arg=input()
x=len(arg)
count=0
d=[]

for i in arg:
    if(i=="A" or i=="C" or i=="G" or i=="T"):
        count=count+1
        d.append(count)
    else:
        count=0

print(max(d))


Fixed code:

arg=input()
x=len(arg)
count=0
d=[0]

for i in arg:
    if(i=="A" or i=="C" or i=="G" or i=="T"):
        count=count+1
        d.append(count)
    else:
        count=0

print(max(d))
Buggy code:
S = list(input())

count = 0
record = 0
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        count += 1
    else:
        if count > record:
            record = count
if count>record:
    record = count

print(record)

Fixed code:
S = list(input())

count = 0
record = 0
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        count += 1
    else:
        if count > record:
            record = count
        count = 0
if count>record:
    record = count

print(record)
Buggy code:
def main():
	# a,b,k = map(int,input().split())
	# n,k = map(int,input().split())
	s = list(str(input()))
	# a = list(map(int,input().split()))
	# rsp = list(str(input()))
	# l = [list(map(int, input().split())) for _ in range(n-1)]
	# s = list(s)
	avoid = 0
	ans = 0
	ans_rec = []
	for i in range(len(s)):
		if s[i] == "A" or s[i] == "T" or s[i] == "G" or s[i] == "C":
			# print("when i = {} is true".format(i))
			ans += 1
		else:
			ans_rec.append(ans)
			ans = 0
			
	print(ans_rec)

 
if __name__ == '__main__':
	main()

Fixed code:
def main():
	# a,b,k = map(int,input().split())
	# n,k = map(int,input().split())
	s = list(str(input()))
	# a = list(map(int,input().split()))
	# rsp = list(str(input()))
	# l = [list(map(int, input().split())) for _ in range(n-1)]
	# s = list(s)
	avoid = 0
	ans = 0
	ans_rec = []
	for i in range(len(s)):
		if s[i] == "A" or s[i] == "T" or s[i] == "G" or s[i] == "C":
			# print("when i = {} is true".format(i))
			ans += 1
		else:
			ans_rec.append(ans)
			ans = 0
	ans_rec.append(ans)
			
	print(max(ans_rec))

 
if __name__ == '__main__':
	main()
Buggy code:
s=input()
ans=0
for length in range(1,len(s)+1):
	for left in range(s-length+1):
		z=s[left:left+length]
		flag=True
		for i in range (length):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag:
			ans+=1
			break
print(ans)
				
				
				
		
		
	


Fixed code:
s=input()
ans=0
for x in range(1,len(s)+1):
	for left in range(len(s)-x+1):
		z=s[left:left+x]
		flag=True
		for i in range(x):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag==True:
			ans+=1
			break
print(ans)
Buggy code:
S = input()
L=len(S)
longest=0
for i in range(L):
  for j in range(i):
    DUP=S[j:i+1]
    DUP=DUP.replace("A","#")
    DUP=DUP.replace("T","#")
    DUP=DUP.replace("G","#")
    DUP=DUP.replace("C","#")
    count=0
    for a in range(len(DUP)):
      if DUP[a]=="#":
        count+=1
      else:
        break
    else:
      longest=max(longest,count+1)
print(longest)

Fixed code:
S = input()
L=len(S)
longest=0
for i in range(L):
  for j in range(i+1):
    DUP=S[j:i+1]
    DUP=DUP.replace("A","#")
    DUP=DUP.replace("T","#")
    DUP=DUP.replace("G","#")
    DUP=DUP.replace("C","#")
    count=0
    for a in range(len(DUP)):
      if DUP[a]=="#":
        count+=1
      else:
        break
    else:
      longest=max(longest,count)
print(longest)
Buggy code:
s = input()
ans = 0
tmp = 0
for c in s:
    print(c)
    if c in "ACGT":
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0
ans = max(ans, tmp)
print(ans)


Fixed code:
s = input()
ans = 0
tmp = 0
for c in s:
    if c in "ACGT":
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0
ans = max(ans, tmp)
print(ans)
Buggy code:
import sys

input = sys.stdin.readline

def main():
    t = 'ATGC'
    ans = 0
    S = input()
    temp = 0
    for s in S:
        if s in t:
            temp += 1
        else:
            ans = max(ans, temp)

    print(ans)

if __name__ == '__main__':
    main()

Fixed code:
import sys

input = sys.stdin.readline

def main():
    t = 'ATGC'
    ans = 0
    S = input()
    temp = 0
    for s in S:
        if s in t:
            temp += 1
        else:
            ans = max(ans, temp)
            temp = 0

    print(ans)

if __name__ == '__main__':
    main()
Buggy code:
s=list(input())
print(s)
print(len(s))
Ans =[0]
ans = 0
for i in range(len(s)):
    if s[i]=='A'or s[i]=='T'or s[i]=='G'or s[i]=='C':
        ans += 1
    else:
        Ans.append(ans)
        ans = 0
Ans.append(ans)
print(Ans)
print(max(Ans))


Fixed code:
s=list(input())
#print(s)
#print(len(s))
Ans =[0]
ans = 0
for i in range(len(s)):
    if s[i]=='A'or s[i]=='T'or s[i]=='G'or s[i]=='C':
        ans += 1
    else:
        Ans.append(ans)
        ans = 0
Ans.append(ans)
#print(Ans)
print(max(Ans))
Buggy code:
 S = input()
 N = len(S)
 ans = 0
 for i in range(N):
 for j in range(i, N):
 if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
 ans = max(ans, j - i + 1)
 print(ans)


Fixed code:
S = input()
N = len(S)
ans = 0
for i in range(N):
    for j in range(i, N):
        if all("ACGT".count(c) == 1 for c in S[i:j + 1]):
            ans = max(ans, j - i + 1)

print(ans)
Buggy code:
def tasu(i):
    global bubun
    if i >= len(string):
        return
    elif string[i] == "A" or string[i] == "C" or string[i] == "G" or string[i] == "T":
        bubun += string[i]
        tasu(i + 1)

string = input()

lst = [""]

for i in range(len(string)):
    if string[i] == "A" or string[i] == "C" or string[i] == "G" or string[i] == "T":
        bubun = ""
        tasu(i)
        lst.append(bubun)

print(len(max(lst)))
print(lst)
print(max(lst))

Fixed code:
def tasu(i):
    global bubun
    if i >= len(string):
        return
    elif string[i] == "A" or string[i] == "C" or string[i] == "G" or string[i] == "T":
        bubun += string[i]
        tasu(i + 1)

string = input()

lst = [""]

for i in range(len(string)):
    if string[i] == "A" or string[i] == "C" or string[i] == "G" or string[i] == "T":
        bubun = ""
        tasu(i)
        lst.append(bubun)

print(len(max(lst, key=len)))
Buggy code:
count = 0
tmp = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        tmp += 1
    else:    
        tmp = 0
    count = max(tmp,count)
print(count)

Fixed code:
s = input()
count = 0
tmp = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        tmp += 1
    else:    
        tmp = 0
    count = max(tmp,count)
print(count)
Buggy code:
S = input()
max = 0
ans = 0

for i in range(10):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G':
    ans += 1
  else:
    if ans >= max:
      max = ans
    else:
      ans = 0

print(max)

Fixed code:
S = input()
max = 0
ans = 0

for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G':
    ans += 1
    if ans > max:
      max = ans
  else:
    ans = 0

print(max)
Buggy code:
S = list(input())
ACGT = ['A','C','G','T']

tans = ''
ans = ''

for i in range(len(S)):
  if S[i] in ACGT:
    tans = tans + S[i]
  else:
    if len(ans) < len(tans):
      ans = tans
    tans = ''

print(ans)
  

Fixed code:
S = list(input())
ACGT = ['A','C','G','T']
 
tans = 0
ans = 0
 
for i in range(len(S)):
  if S[i] in ACGT:
    tans += 1 
    if ans < tans:
        ans = tans
  else:
    tans = 0


print(ans)
Buggy code:
ACGT = ["A", "C" ,"G", "T"]
s = input()
ans = 0, temp = 0
for i in s:
  ok = False
  for j in ACGT:
    if i == j:
      ok = True
      temp += 1
  if ok == False:
    ans = max(ans, temp)
    temp = 0
ans = max(ans, temp)
print(ans)

Fixed code:
ACGT = ["A", "C" ,"G", "T"]
s = input()
ans = 0
temp = 0
for i in s:
  ok = False
  for j in ACGT:
    if i == j:
      ok = True
      temp += 1
  if ok == False:
    ans = max(ans, temp)
    temp = 0
ans = max(ans, temp)
print(ans)
Buggy code:
s=list(str(input()))
li=["A","C","G","T"]
ans=0
x=[]
for i in range(0,len(s)):
  if s[i] in li:
    ans+=1
    x.append(ans)
  else:
    ans=0
        
print(max(x))

Fixed code:
s=list(str(input()))
li=["A","C","G","T"]
ans=0
x=[0]
for i in range(0,len(s)):
  if s[i] in li:
    ans+=1
    x.append(ans)
  else:
    ans=0
        
print(max(x))
Buggy code:
s = input()
s2 = ''
for c in s:
    if c in ('A','T','C','G'):
        s2 += '1'
    else:
        s2 += '0'

tmp = 0
ret = 0
for c in s2:
    if c == '1':
        tmp += 1
    else:
        ret = max(ret, tmp)
print(tmp)


Fixed code:
s = input()
s2 = ''
for c in s:
    if c in ('A','T','C','G'):
        s2 += '1'
    else:
        s2 += '0'


tmp = 0
ret = 0
for c in s2:
    if c == '1':
        tmp += 1
    else:
        ret = max(ret, tmp)
        tmp = 0
ret = max(ret, tmp)
print(ret)
Buggy code:
s=str(input())
ans=1
counter=0
for i in s:
	if "A" == i: counter+=1
	elif "C" == i: counter+=1
	elif "G" == i: counter+=1
	elif "T" == i: counter+=1
	else: counter=0
	ans=max(ans,counter)
print(ans)

Fixed code:
s=str(input())
ans=0
counter=0
for i in s:
	if "A" == i: counter+=1
	elif "C" == i: counter+=1
	elif "G" == i: counter+=1
	elif "T" == i: counter+=1
	else: counter=0
	ans=max(ans,counter)
print(ans)
Buggy code:
S = input()
max_l = 0
temp_l = 0

for s in S:
    if s == 'A' or s=='G' or s=='C' or s=='T':
        temp_l += 1
        
    else:
      	max_l = max(max_l, temp_l)
        temp_l = 0

print(max_l)


Fixed code:
S = input()
max_l = 0
temp_l = 0

for s in S:
    if s == 'A' or s=='G' or s=='C' or s=='T':
        temp_l += 1
        max_l = max(max_l, temp_l)
    else:
        temp_l = 0

print(max_l)