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

cnt = 0
mcnt = 0
for i in S:
    print(i)
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        cnt += 1
        mcnt = max(mcnt,cnt)

print(mcnt)


Fixed code:
S = input()

cnt = 0
mcnt = 0
for i in S:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        cnt += 1
        mcnt = max(mcnt,cnt)
    else:
        cnt = 0

print(mcnt)
Buggy code:
import re
print(max(map(len, re.split('[ACGT]',input()))))

Fixed code:
import re
print(max(map(len, re.split('[^ACGT]',input()))))
Buggy code:
s = list(input())

cnt = []
c = 0
for i in s:
    print(i)
    if i == "A" or i == "C" or i == "G" or i =="T":
        c += 1
    else:
        cnt.append(c)
        c = 0

print(max(cnt))


Fixed code:
s = list(input())

cnt = []
c = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        c += 1
    else:
        cnt.append(c)
        c = 0
cnt.append(c)

print(max(cnt))
Buggy code:
s = input()
ans = 0
l = []
for i in range(len(s)):
    if s[i] in list('ACGT'):
        ans += 1
    else:
        l.append(ans)
        ans = 0
l.append(ans)
print(max(li))


Fixed code:
s = list(input())
n = len(s)
ans = 0
li = []
for i in range(n):
    if s[i] in list('ACGT'):
        ans += 1
    else:
        li.append(ans)
        ans = 0
li.append(ans)
print(max(li))
Buggy code:
s = input()
dic_ = str.maketrans({'T':'1','A':'1','C':'1','G':'1'})
s = s.translate(dic_)
count = 0
result = 0
pre_i = ''
print(s)

for i in s:
  if pre_i == '1' and i == '1':
    count += 1
  elif pre_i =='1':
    if count > result:
      result = count
    count = 0
    pre_i = ''
  
  elif i == '1':
    count += 1
    pre_i = '1'
print(result)

Fixed code:
s = input()
dic_ = str.maketrans({'T':'1','A':'1','C':'1','G':'1'})
s = s.translate(dic_)
count = 0
result = 0
pre_i = ''

for i in s:
  if pre_i == '1' and i == '1':
    count += 1
    
  elif pre_i =='1':
    if count > result:
      result = count
    count = 0
    pre_i = ''
  
  elif i == '1':
    count += 1
    pre_i = '1'
if result < count:
  result = count
print(result)
Buggy code:
S=list(input())

count=0
max=0

for moji in list:
  if moji==("A"or"T"or"G"or"C"):
    count+=1
    if count>max:
      max=count
  else:
    count=0
print(max)

Fixed code:
S = list(input())

count = 0
max = 0

for moji in S:
    if moji == "A"or moji == "T"or moji == "G"or moji == "C":
        count += 1
        if count > max:
            max = count
    else:
        count = 0
print(max)
Buggy code:
S = input()
s = len(S)
L = []
temp = 0
for i in range(s):
    if S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C':
        if temp ==0:
            temp=1
        else:
            temp*=10
            L.append(temp)
    else:
        temp = 0
L.append(0)        
if L[-1]==0:
    P=0
else:
    P = len(str(max(L)))
print(P)

Fixed code:
S = input()
s = len(S)
L = []
temp = 0
for i in range(s):
    if S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C':
        if temp ==0:
            temp=1
            L.append(temp)
        else:
            temp*=10
            L.append(temp)
    else:
        temp = 0
L.append(-1)        
if len(L)==2 and L[0]==0:
    P=0
elif len(L)==1:
    P=0
else:
    P = len(str(max(L)))
print(P)
Buggy code:
x=input()
m=-1
for i in range(len(x)):
    for j in range(i,len(x)):
        #print(x[i])
        if x[j] not in ["A","G","C","T"]:
            #print(j)
            break
        else:
            m=max(m,j-i+1)
print(m)
        
            


Fixed code:
x=input()
m=0
for i in range(len(x)):
    for j in range(i,len(x)):
        #print(x[i])
        if x[j] not in ["A","G","C","T"]:
            #print(j)
            break
        else:
            m=max(m,j-i+1)
print(m)
Buggy code:
s = str(input())
ACGT = {"A", "C", "G", "T"}

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


Fixed code:
s = str(input())
ACGT = {"A", "C", "G", "T"}

ans = 0
for i in range(len(s)):
    for j in range(i, len(s) + 1):
        t = s[i: j]
        for k in t:
            if k not in ACGT:
                break
        else:
            ans = max(ans, len(t))
print(ans)
Buggy code:
S = input()
ans = 0
cnt = 0
for i in range(len(S)):
  if S[i] == "A" or S[i] =="G" or S[i] =="C" orS[i] =="T":
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)

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

print(max(ans,cnt))
Buggy code:
# -*- coding:utf-8 -*-

s = input()


count = 0
max = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "G" or s[i] == "T" or s[i] == "C":
        count += 1
        if i == len(s)-1:
          max = count
    else:
        if max < count:
            max = count
        count = 0
print(max)

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

s = input()


count = 0
max = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "G" or s[i] == "T" or s[i] == "C":
        count += 1
        if (i == len(s)-1) and (max < count):
          max = count
    else:
        if max < count:
            max = count
        count = 0
print(max)
Buggy code:
S = str(input())
counter = 0
max = 0

for i in S:
    if i == 'A' or i == 'T' or i == 'C' or i == 'G':
        counter += 1
        if counter >= max:
            max = counter
    else:
        counter = 0

print(counter)

Fixed code:
S = str(input())
counter = 0
max = 0

for i in S:
    if i == 'A' or i == 'T' or i == 'C' or i == 'G':
        counter += 1
        if counter >= max:
            max = counter
    else:
        counter = 0

print(max)
Buggy code:
mx, h = [], []
for ch in input():
    print(h)
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    print(max([len(l) for l in mx]))


Fixed code:
mx, h = [], []
for ch in str(input()):
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    mx += [h]
    print(max([len(l) for l in mx]))
Buggy code:
S = input()
acgt = ["A","C","G","T"]
S_tf = [any([sss == aaa for aaa in acgt]) for sss in S]
print(S_tf)
maxlen = 0
curlen = 0
for i in S_tf:
    if i:
        curlen += 1
        if maxlen < curlen:
            maxlen = curlen
    else:
        curlen = 0
print(maxlen)

Fixed code:
S = input()
acgt = ["A","C","G","T"]
S_tf = [any([sss == aaa for aaa in acgt]) for sss in S]
maxlen = 0
curlen = 0
for i in S_tf:
    if i:
        curlen += 1
        if maxlen < curlen:
            maxlen = curlen
    else:
        curlen = 0
print(maxlen)
Buggy code:
S = input()
T = "ACGT"
ans = 0
for s in S:
    if s in T:
        cnt += 1
    else:
        if cnt > ans:
            ans = cnt
        cnt = 0
print(ans)

Fixed code:
S = input()
T = "ACGT"
ans = 0
cnt = 0
for s in S:
    if s in T:
        cnt += 1
    else:
        if cnt > ans:
            ans = cnt
        cnt = 0
if cnt>ans:
    ans = cnt
print(ans)
Buggy code:
S = input()
cnt=0
ans = 0
sets = {A,T,C,G}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)

Fixed code:
S = input()
cnt=0
ans = 0
sets = {"A","T","C","G"}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
ans = max(ans,cnt)
print(ans)
Buggy code:
S = list(input())
answer = 0

for i in range(len(S)):
    counter = 0
    for j in range(i,len(S)):
        if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
            counter += 1
            print(counter)
        else:
            if counter > answer:
                answer = counter
            break
print(answer)

Fixed code:
S = list(input())
answer = 0

for i in range(len(S)):
    counter = 0
    for j in range(i,len(S)):
        if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
            counter += 1  
            if j == len(S)-1:
                if counter > answer:
                    answer = counter
        else:
            if counter > answer:
                answer = counter
            break
print(answer)
Buggy code:
S=input()
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
  else:
    count=0
  if max<count:
    max=count
print(count)

Fixed code:
S=list(input())
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
      max=count
  else:
    count=0
print(max)
Buggy code:
S = input()
acgt = ["A", "C", "G", "T"]
cnts = []
cnt = 0
for i in range(len(S)):
	if S[i] in acgt:
		cnt += 1
		cnts.append(cnt)
	else:
		cnt = 0
print(max(cnts))


Fixed code:
S = input()
acgt = ["A", "C", "G", "T"]
cnts = []
cnt = 0
for i in range(len(S)):
	if S[i] in acgt:
		cnt += 1
		cnts.append(cnt)
	else:
		cnts.append(cnt)
		cnt = 0
print(max(cnts))
Buggy code:
str = input()
max = 0
for chr in str:
  if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
    count += 1
   	if count > max:
      max = count
  else:
  	count = 0
print({}.format(max))

Fixed code:
str = input()
max = 0
count = 0
for chr in str:
    if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
        count += 1
        if count > max:
            max = count
    else:
        count = 0
print('{}'.format(max))
Buggy code:
inp = input()
res = 0
for i in range(len(inp)):
	for j in range(i, len(inp)):
    	if len([w for w in inp[i:j] if w in ["A", "C", "G", "T"]]) == (j-i):
        	res = max(res, j-i)
print(res)

Fixed code:
inp = input()
res = 0
for i in range(len(inp)+1):
  for j in range(i+1, len(inp)+1):
    if len([w for w in inp[i:j] if w in ["A", "C", "G", "T"]]) == (j-i):
      res = max(res, j-i)
print(res)
Buggy code:
s = input()
word = ['A', 'C', 'G', 'T']
count = 0
tmp = 0

for i in s:
    if word.count(i) == 1:
        tmp += 1
    else:
        tmp = 0

    if count < tmp:
        count += tmp
print(count)

Fixed code:
s = input()
word = ['A', 'C', 'G', 'T']
count = 0
tmp = 0

for i in s:
    if word.count(i) == 1:
        tmp += 1
    else:
        tmp = 0

    if count < tmp:
        count = tmp
print(count)
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()
ret = 0
for x in range(len(S)):
    for y in range(x + 1, len(S) + 1):
        s = S[x:y]
        print(s)
        if all([x in 'ACGT' for x in s]):
            ret = max(ret, len(s))
print(ret)

Fixed code:
S = input()
ret = 0
for x in range(len(S)):
    for y in range(x + 1, len(S) + 1):
        s = S[x:y]
        if all([x in 'ACGT' for x in s]):
            ret = max(ret, len(s))
print(ret)
Buggy code:
S = input()

text = ""
ans = 0
for idx, moji in enumerate(S):
    
    if moji == "A" or moji == "C" or moji == "G" or moji == "T":
        text += moji
        for j in range(idx+1,len(S)):
            if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
                text += S[j]
            else:
                if "T" in text and len(text) > ans:
                    print(text)
                    ans = len(text)
                text = ""
                break
    else:
        text = ""

print(ans)

Fixed code:
S = input()

text = ""
ans = 0
for idx, moji in enumerate(S):
    
    if moji == "A" or moji == "C" or moji == "G" or moji == "T":
        text += moji
        for j in range(idx+1,len(S)):
            if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
                text += S[j]
                #print(0, text)
            else:
                #print(-1, text)
                if len(text) > ans:
                    ans = len(text)
                text = ""
                break
        if len(text) > ans:
            ans = len(text)
        text = ""
    else:
        text = ""

print(ans)
Buggy code:
s = input()
letters = ["A","G","C","T"]
counter = 0
record = 0

for letter in s:
    if letter in letters:
        counter += 1
    else:
        counter = 0
else:
    record = max(record,counter)
    print(record)

Fixed code:
s = input()
letters = ["A","G","C","T"]
counter = 0
record = 0

for letter in s:
    if letter in letters:
        counter += 1
    else:
        record = max(record,counter)
        counter = 0

record = max(record,counter)

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

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

ans = max(ans, k)
print(ans)
Buggy code:
Ss=[i for i in input()]
anss = []
counter = 0
for i in range(len(Ss)):
    if Ss[i]=="A" and Ss[i]=="C" and Ss[i]!="G" and Ss[i]!="T":
        anss.append(counter)
        counter=0
    else:
        counter+=1
if len(anss)!=0:
    print(max(anss))
else:
    print(0)

Fixed code:
Ss=[i for i in input()]
anss = []
counter = 0
for i in range(len(Ss)):
    if Ss[i]!="A" and Ss[i]!="C" and Ss[i]!="G" and Ss[i]!="T":
        anss.append(counter)
        counter=0
    else:
        counter+=1
        anss.append(counter)
if len(anss)!=0:
    print(max(anss))
else:
    print(0)
Buggy code:
#ABC 122, B - ATCoder
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:
#ABC 122, B - ATCoder
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()

acgt_s = "ACGT"
count_s = 0
count_max = 0

for i in s:
    for j in acgt_s:
        if j == i:
            count_s += 1
            break
    else:
        count_max = max(count_max, count_s)
        print(count_max)
        count_s = 0

count_max = max(count_max, count_s)
print(count_max)


Fixed code:
s = input()

acgt_s = "ACGT"
count_s = 0
count_max = 0

for i in s:
    for j in acgt_s:
        if j == i:
            count_s += 1
            count_max = max(count_max, count_s)
            break
    else:
        count_s = 0


print(count_max)
Buggy code:
s = input()

s.append("X")
pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
        count = 0

print(mx)


Fixed code:
s = input()

s += "X"
pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
        count = 0

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

c=0
ans=0
for word in S:
    c+=1 if word in acgt else 0
    ans = max(ans, c)
print(ans)


Fixed code:
S = list(input())
acgt = ['A', 'C', 'G', 'T']

c=0
ans=0
for word in S:
    c = c+1 if word in acgt else 0
    ans = max(ans, c)
print(ans)
Buggy code:
a = list(input())
ans = 0
count = 0
for i in a:
     if i in ['A','T','C','G']:
          count += 1
     else:
          ans = max(count,ans)
ans = max(count,ans)
print(ans)

Fixed code:
a = list(input())
ans = 0
count = 0
for i in a:
     if i in ['A','T','C','G']:
          count += 1
     else:
          ans = max(count,ans)
          count = 0
ans = max(count,ans)
print(ans)
Buggy code:
s = input()

ma = 0
for i in range(len(s)):
    for j in range(0,len(s)-i+1):
        sbstr = s[i:i+j+1]
        print(i,j,sbstr)
        is_good = True
        for c in sbstr:
            if c not in "AGCT":
                is_good = False
                break
        if is_good:
            if (len(sbstr)) > ma :
                ma = len(sbstr)

print(ma)


Fixed code:
s = input()

ma = 0
for i in range(len(s)):
    for j in range(1,len(s)-i+1):
        tmp = s[i:i+j]
        # print(i,j,tmp)
        is_good = True
        for c in tmp:
            if c not in "AGCT":
                is_good = False
                break
        if is_good:
            if (len(tmp)) > ma :
                ma = len(tmp)

print(ma)
Buggy code:
S = input()
N = len(S)


AGTC = ['A', 'G', 'T', 'C']
part_l = []
for i in range(N):

        if S[i] in AGTC:
                if i == 0:
                        part = [S[i]]
                elif S[i-1] in AGTC:
                        part.append(S[i])
                else:
                        part = [S[i]]
        else:
                if i == 0:
                        part = []
                elif S[i-1] in AGTC:
                        part_l.append(part)
                        part = []
part_l.append(part)

print(part_l)
max_part = []          
for part in part_l:
        if len(part) > len(max_part):
                max_part = part

print(len(max_part))

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


AGTC = ['A', 'G', 'T', 'C']
part_l = []
for i in range(N):

        if S[i] in AGTC:
                if i == 0:
                        part = [S[i]]
                elif S[i-1] in AGTC:
                        part.append(S[i])
                else:
                        part = [S[i]]
        else:
                if i == 0:
                        part = []
                elif S[i-1] in AGTC:
                        part_l.append(part)
                        part = []
part_l.append(part)

max_part = []          
for part in part_l:
        if len(part) > len(max_part):
                max_part = part

print(len(max_part))
Buggy code:
import re

S = input()
pattern = "[ATGC]*"

matched_list = sorted(re.findall(pattern, S),
                      key=lambda s: len(s),
                      reverse=True)
print(matched_list)
print(len(matched_list[0]))


Fixed code:
import re

S = input()
pattern = "[ATGC]*"

matched_list = sorted(re.findall(pattern, S),
                      key=lambda s: len(s),
                      reverse=True)
print(len(matched_list[0]))
Buggy code:
S = input()
atcg = ['A', 'C', 'T', 'G']
ans = 0
count = 0
for i in range(S):
  if S[i] in atcg:
    count += 1
    ans = max(count, ans)
  else:
    count = 0
print(ans)

Fixed code:
S = input()
atcg = ['A', 'C', 'T', 'G']
ans = 0
count = 0
for i in range(len(S)):
  if S[i] in atcg:
    count += 1
    ans = max(count, ans)
  else:
    count = 0
print(ans)
Buggy code:
S = input()
S_list = list(S)
S_ex = ''.join((['1' if (k == 'A' or k == 'C' or k == 'G' or k == 'T') else '0' for k in S_list]))
S_ans = [len(k) for k in S_ex.split('0')]
max(S_ans)

Fixed code:
S = input()
S_list = list(S)
S_ex = ''.join((['1' if (k == 'A' or k == 'C' or k == 'G' or k == 'T') else '0' for k in S_list]))
S_ans = [len(k) for k in S_ex.split('0')]
print(max(S_ans))
Buggy code:
list1 = list(input())
maxlen = 0
count = 0
for i in range(len(list1)):
    if list1[i] == "A" or "T" or "C" or "G":
        count += 1
    else:
        maxlen = max(maxlen,count)
        count = 0
print(maxlen)

Fixed code:
list1 = list(input())
maxlen = 0
count = 0
for i in range(len(list1)):
    if list1[i] == "A" or \
    list1[i] == "T" or \
    list1[i] == "C" or \
    list1[i] == "G":
        count += 1
    else:
        maxlen = max(maxlen,count)
        count = 0
maxlen = max(maxlen,count)
print(maxlen)
Buggy code:
S=input()
ACGT=["A","C","G","T"]
m=0
for i in range(len(S)):
  j=0
  while S[i+j] in ACGT:
    j+=1   
  m=max(m,j)
print(m)

Fixed code:
S=input()
SS=S+"X"
ACGT=["A","C","G","T"]
m=0
for i in range(len(S)):
  j=0
  while SS[i+j] in ACGT:
    j+=1   
  m=max(m,j)
print(m)
Buggy code:
S = str(input())
sam = ['A','C','G','T']
box = []
count = 0
for i in range(len(S)):
    if i == 0 and S[i] in sam:
        count+=1
    elif i > 0:
        if count == 0 and S[i] in sam:
            count+=1
        elif S[i] in sam and S[i-1] in sam:
            count+=1
        else:
            box.append(count)
            count=0
        
print(count)
        

Fixed code:
S = str(input())
sam = ['A','C','G','T']
box = []
count = 0
for i in range(len(S)):
    if i == 0 and S[i] in sam:
        count+=1
    elif i > 0:
        if count == 0 and S[i] in sam:
            count+=1
        elif S[i] in sam and S[i-1] in sam:
            count+=1
        else:
            box.append(count)
            count=0
box.append(count)
        
print(max(box))
Buggy code:
S = list(input())
count = 1 if S[0] in lis else 0
lis = ['A','T','C','G']
ans = 1 if S[0] in lis else 0
for i in range(1,len(S)):
  if S[i] in lis:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
print(ans)
    

Fixed code:
S = list(input())
S.append('fuck')
lis = ['A','T','C','G']
count = 1 if S[0] in lis else 0
ans = 1 if S[0] in lis else 0
for i in range(1,len(S)):
  if S[i] in lis:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
print(ans)
Buggy code:
S = input()
n = 0
atgc = [0] * len(S)

for i in S:
    if i == ('A' or 'C' or 'G' or 'T'):
        atgc[n] += 1
    else:
        n += 1
        
ans = min(atgc)
print(ans)

Fixed code:
S = input()
n = 0
atgc = [0] * len(S)

for i in S:
    if ('A' in i) or ('C' in i) or ('G' in i) or ('T' in i):
        atgc[n] += 1
    else:
        n += 1
        
ans = max(atgc)
print(ans)
Buggy code:
s=input()

tmp=0
length=[]

for i in range(len(s)):
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        tmp+=1
        if i==len(s)-1:
            length.append(tmp)
    else:
        length.append(tmp)
        tmp=0
print(length)

Fixed code:
s=input()

tmp=0
length=[]

for i in range(len(s)):
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        tmp+=1
        if i==len(s)-1:
            length.append(tmp)
    else:
        length.append(tmp)
        tmp=0
print(max(length))
Buggy code:
s = input()
n = len(s)
ans = -1e9
for i in range(n):
    for j in range(i, n):
        ok = True
        for k in range(i, j + 1):
            if s[k] not in ['A', 'T', 'G', 'C']:
                ok = False
        if ok:
            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):
        ok = True
        for k in range(i, j + 1):
            if s[k] not in ['A', 'T', 'G', 'C']:
                ok = False
        if ok:
            ans = max(ans, j - i + 1)
print(ans)
Buggy code:
S = str(input())
max = -1
for i in range(len(S)):
    k = 1
    if not(S[i] in {'A','T','G','C'}):
        continue
    for j in range(i+1,len(S)):
       if S[j] in {'A','T','G','C'}:
           k+=1
       else:
           break

    if k > max:
        max = k

print(max)

Fixed code:
S = str(input())
max = 0
for i in range(len(S)):
    k = 0
    if not(S[i] in {'A','T','G','C'}):
        continue
    k = 1
    for j in range(i+1,len(S)):
       if S[j] in {'A','T','G','C'}:
           k+=1
       else:
           break

    if k > max:
        max = k

print(max)
Buggy code:

N = input()
charlist = list(N)
hoge = 0
maxscore = 0
def onon(char, hogehoge):
    nowscore = 0
    while char[hogehoge] == "A" or char[hogehoge] == "T" or char[hogehoge] == "G" or char[hogehoge] == "C" :
        hogehoge = hogehoge + 1
        nowscore += 1
    return nowscore 
for i in charlist:
    score = 0
    if i == "A" or i == "T" or i == "G" or i == "C"  :
        score = onon(charlist,hoge)
    if maxscore <= score:
        maxscore = score
    hoge = hoge + 1
print(maxscore)


Fixed code:
N = input()
charlist = list(N)
hoge = 0
maxscore = 0
def onon(char, hogehoge):
    nowscore = 0
    while char[hogehoge] == "A" or char[hogehoge] == "T" or char[hogehoge] == "G" or char[hogehoge] == "C" :
        hogehoge = hogehoge + 1
        nowscore += 1
        if hogehoge  >= len(char):
            break
    return nowscore 
for i in charlist:
    score = 0
    if i == "A" or i == "T" or i == "G" or i == "C"  :
        score = onon(charlist,hoge)
    if maxscore <= score:
        maxscore = score
    hoge = hoge + 1
print(maxscore)