qyliang/CodeNanoFix huggingface dataset:
Buggy code:
s = input()
l = len(s)
a = [0]*l
for i in range(l):
    if s[i] == "A" or s[i] =="T" or s[i] =="C" or s[i] =="G":
        a[i] = 1
m = 0
if a[0] = 1:
  m = 1
for i in range(1,l):
    a[i] = (a[i-1]+1)*a[i]
    if m < a[i]:
        m = a[i]

print(m)

Fixed code:
s = input()
l = len(s)
a = [0]*l
for i in range(l):
    if s[i] == "A" or s[i] =="T" or s[i] =="C" or s[i] =="G":
        a[i] = 1
m = 0
if a[0] == 1:
  m = 1
for i in range(1,l):
    a[i] = (a[i-1]+1)*a[i]
    if m < a[i]:
        m = a[i]

print(m)
Buggy code:
ml = 0
s = str(input())
acgt = ["A","C", "G", "T"]

def count_acgt(s, i):
    v = 0
    for t in range(i, len(s)):
        if s[t] in acgt:
            v += 1
    return v

for i, _ in enumerate(s):
    n = count_acgt(s, i)
    if n >= ml:
        ml = n

print(ml)

Fixed code:
ml = 0
s = str(input())
acgt = ["A","C", "G", "T"]

def count_acgt(s, i):
    v = 0
    for t in range(i, len(s)):
        if s[t] in acgt:
            v += 1
        else:
            break
    return v

for i, _ in enumerate(s):
    n = count_acgt(s, i)
    if n >= ml:
        ml = n

print(ml)
Buggy code:
S=input()

actg_list=[]
for i in range(len(S)):
  for j in range(i+1,len(S)+1):
    slen=len(S[i:j])
    temp=0
    for s in S[i:j] :
      if s=='A' or s=='C' or s=='G' or s== 'T':
        temp+=1      
    if temp==slen:
      atcg_list.append(slen)
      
print(max(atcg_list))

Fixed code:
S=input()
 
acgt_list=[0]
for i in range(len(S)):
  for j in range(i+1,len(S)+1):
    slen=len(S[i:j])
    temp=0
    for s in S[i:j] :
      if s=='A' or s=='C' or s=='G' or s== 'T':
        temp+=1      
    if temp==slen:
      acgt_list.append(slen)
      
print(max(acgt_list))
Buggy code:
S = input()

c_max = 0
cnt = 0

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

print(c_max)


Fixed code:
S = input()

c_max = 0
cnt = 0

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

print(c_max)
Buggy code:
# -*- coding: utf-8 -*-
# input
#a = int(input())
a = input()
#a, b, c = map(int, input().split())
#a, b, c = input().split()
o = 0
#o = []

# calc
for i in range(len(a)):
    t = 1
    if a[i] in ('A', 'C', 'G', 'T'):
        k = i+1
        for j in range(len(a)-k):
            if a[j+k] in ('A', 'C', 'G', 'T'):
                t += 1
                # print(t)
                if j+k+1 == len(a) and o < t:
                    o = t
            else:
                if o < t:
                    o = t
# output
print(o)
# for i in range(a):
#    print(o[i])

Fixed code:
# -*- coding: utf-8 -*-
# input
#a = int(input())
a = input()
#a, b, c = map(int, input().split())
#a, b, c = input().split()
o = 0
#o = []

# calc
for i in range(len(a)):
    if a[i] in ('A', 'C', 'G', 'T'):
        t = 1
        for j in range(i+1, len(a)):
            if a[j] in ('A', 'C', 'G', 'T'):
                t += 1
                # print(a[j])
               # if j == len(a)-1 and o < t:
               #     o = t
            else:
               # if o < t:
               #     o = t
                break
        if o < t:
            o = t

# output
print(o)
# for i in range(a):
#    print(o[i])
Buggy code:
s = input()
count = 0
mx = 0
for i in s:
    if i=="A" or i=="C" or i=="G" or i=="T":
        count += 1
    else:
        if mx < count:
            mx = count
print(max(mx,count))

Fixed code:
s = input()
count = 0
mx = 0
for i in s:
    if i=="A" or i=="C" or i=="G" or i=="T":
        count += 1
        mx = max(count,mx)
    else:
        count = 0
print(mx)
Buggy code:
str = input()
S = list(str)

ans = 0
num = 0

for i in range(len(str)):
  if list[i] == "A" or list[i] == "G" or list[i] == "T" or list[i] == "C":
    num = 1
    for j in range(len(str)):
      list[j] == "A" or list[j] == "G" or list[j] == "T" or list[i] == "j":
        num = num + 1
      else :
        break
  if ans < num :
    ans = num
  num = 0
  
print(ans)

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

ans = 0
num = 0

for i in range(len(S)):
  if S[i] == "A" or S[i] == "G" or S[i] == "T" or S[i] == "C":
    num = 1
    for j in range(i+1,len(S)):
      if S[j] == "A" or S[j] == "G" or S[j] == "T" or S[j] == "C":
        num = num + 1
      else :
        break
  if ans < num :
    ans = num
  num = 0
  
print(ans)
Buggy code:
import re 
S = input()

p = re.compile('[ATCG]+')
f = p.finditer

candidate = [i.span()[1]- i.span()[0] for i in f]
if candidate == [] :
    print(0)
else :
    print(max(candidate))

Fixed code:
import re 
S = input()
 
p = re.compile('[ATCG]+')
f = p.finditer(S)
 
candidate = [i.span()[1]- i.span()[0] for i in f]
if candidate == [] :
    print(0)
else :
    print(max(candidate))
Buggy code:
s = input()

max_score = 0
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
    score += 1
  else:
    if max_score < score:
      max_score = score
    score = 0

      
print(max_score)

Fixed code:
s = input()

max_score = 0
score = 0
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
    score += 1
    if max_score <= score:
      max_score = score
  else:
    if max_score <= score:
      max_score = score
    score = 0
  
 
      
print(max_score)
Buggy code:
S=input()
gene=['A','C','G','T']
c=0
maximum=0
for i in range(len(S)):
  if S[i] in gene:
    c+=1
  else:
    count=0
  maximum = max(maximum, c)
print(maximum)


Fixed code:
S=input()
gene=['A','C','G','T']
c=0
maximum=0
for i in range(len(S)):
  if S[i] in gene:
    c+=1
  else:
    c=0
  maximum = max(maximum, c)
print(maximum)
Buggy code:
atcoder = input()
ACGT = list('ACGT')

s = ''
sub_list = []
for i, l in enumerate(list(atcoder)):
    if l in ACGT:
        s += l
        if i == len(atcoder)-1:
            sub_list.append(len(s))
    else:
        if s != '':
            sub_list.append(len(s))
        s = ''
print(max(sub_list))


Fixed code:
atcoder = input()
ACGT = list('ACGT')

s = ''
sub_list = []
for i, l in enumerate(list(atcoder)):
    if l in ACGT:
        s += l
        if i == len(atcoder)-1:
            sub_list.append(len(s))
    else:
        sub_list.append(len(s))
        s = ''
print(max(sub_list))
Buggy code:
S = str(input())

count = 0
result = []

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

max = result[0]
    
for j in range(len(result)):
  if max < result[j]:
    max = result[j]

print(max)

Fixed code:
S = str(input())

count = 0
result = []

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

maxi = result[0]
    
for j in range(len(result)):
  if maxi < result[j]:
    maxi = result[j]

print(maxi)
Buggy code:
S = input()
ans = 0 
ans_lis = [0]

for i in range(len(S)):
    if S[i] in ACGT:
        ans = ans + 1 
        if i == (len(S)-1):
            ans_lis.append(ans)
    else:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))

Fixed code:
S = input()

ans = 0 
ans_lis = [0]

for i in range(len(S)):
    if S[i] in "ACGT":
        ans = ans + 1 
        if i == (len(S)-1):
            ans_lis.append(ans)
    else:
        ans_lis.append(ans)
        ans = 0 

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

print(max(ans,count))


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

count = 0
max = 0

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

print(max)     

Fixed code:
S = str(input())
listS = list(S)

count = 0
max = 0

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

print(max)
Buggy code:
if __name__ == '__main__':
  V = input()
  
  print(V)
  
  flg = 0
  max_v = 0
  for i in V:
    print(i)
    if i == 'A' or i=='T' or i=='G' or i=='C':
      flg += 1
      max_v = max(max_v, flg)
    else:
      flg += 0
      
  print(max_v)

Fixed code:
if __name__ == '__main__':
  V = input()
  
  #print(V)
  
  flg = 0
  max_v = 0
  for i in V:
    #print(i)
    if i == 'A' or i=='T' or i=='G' or i=='C':
      flg += 1
      max_v = max(max_v, flg)
    else:
      flg = 0
      
  print(max_v)
Buggy code:
max_num = 0
num = 0
for c in input():
    if c in {"A", "C", "G", "T"}:
        num += 1
    else:
        max_num = max(max_num, num)
max_num = max(max_num, num)
print(max_num)


Fixed code:
max_num = 0
num = 0
for c in input():
    if c in {"A", "C", "G", "T"}:
        num += 1
    else:
        max_num = max(max_num, num)
        num = 0
max_num = max(max_num, num)
print(max_num)
Buggy code:
S = input()
a = 0
count=[]

for i in range(len(S)):
  if S[i] in ["A", "C", "G", "T"]:
    a += 1
    count.append(a)
  else:
    a = 0
print(max(list(map(int, count))))

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

for i in range(len(S)):
  if S[i] in ["A", "C", "G", "T"]:
    a += 1
    count.append(a)
  else:
    a = 0
    count.append(a)
print(max(list(map(int, count))))
Buggy code:
s = str(input())
s += "B"
l = len(s)
c = 0
mx = 0
for i in range(l):
  if s[i] in ["A","G","C","T"]:
    c += 1
  else:
    if c > mx:
      mx = c
      c = 0
    else:
      c = 0
    
    

Fixed code:
s = str(input())
s += "B"
l = len(s)
c = 0
mx = 0
for i in range(l):
  if s[i] in ["A","G","C","T"]:
    c += 1
  else:
    if c > mx:
      mx = c
      c = 0
    else:
      c = 0
print(mx)
Buggy code:
S = input()
l = []
for i in S:
    l.append(i)

c = 0
cnt = []
for j in range(len(l)):
    if l[j] == 'A' or l[j] == 'T' or l[j] == 'C' or l[j] == 'G':
        c+=1
        cnt.append(c)
    else:
        cnt.append(c)
        c = 0

print(cnt)
print(max(cnt))


Fixed code:
S = input()
l = []
for i in S:
    l.append(i)

c = 0
cnt = []
for j in range(len(l)):
    if l[j] == 'A' or l[j] == 'T' or l[j] == 'C' or l[j] == 'G':
        c+=1
        cnt.append(c)
    else:
        cnt.append(c)
        c = 0

#print(cnt)
print(max(cnt))
Buggy code:
S = input()
res = 0
count = 0
for s in S:
    if s in ['A', 'C', 'G', 'T']:
        print(s)
        count += 1
    else:
        count = 0
    res = max(count, res)

print(res)


Fixed code:
S = input()
res = 0
count = 0
for s in S:
    if s in ['A', 'C', 'G', 'T']:
        count += 1
    else:
        count = 0
    res = max(count, res)

print(res)
Buggy code:
S = input()
n = []
k=0
for c in S:
    if c in 'ACGT':
        k+=1
    elif k>0:
        n.append(k)
        k=0
if k>0: n.append(k)

print(max(n))

Fixed code:
S = input()
n = [0]
k=0
for c in S:
    if c in 'ACGT':
        k+=1
    elif k>0:
        n.append(k)
        k=0
if k>0: n.append(k)

print(max(n))
Buggy code:
S="AFA"
ans=0
cnt=0
for s in S:
    if s in "A":
        cnt+=1
    elif s in "C":
        cnt+=1
    elif s in "G":
        cnt+=1
    elif s in "T":
        cnt+=1   
    else:
        cnt=0
    ans=max(ans,cnt)
print(ans)

Fixed code:
S=input()
ans=0
cnt=0
for s in S:
    if s in "A":
        cnt+=1
    elif s in "C":
        cnt+=1
    elif s in "G":
        cnt+=1
    elif s in "T":
        cnt+=1   
    else:
        cnt=0
    ans=max(ans,cnt)
print(ans)
Buggy code:
S=input()
max_count=0
for i in range(len(S)):
  if S[i] in [A,C,G,T]:
    j=0
    while S[i+j] in [A,C,G,T]:
      max_count=max(max_count,j)
      j+=1
      if i+j==len(S):
        break
print(max_count)

Fixed code:
S=input()
max_count=0
for i in range(len(S)):
    if S[i] in ['A','C','G','T']:
        j=0
        while S[i+j] in ['A','C','G','T']:
            max_count=max(max_count,j+1)
            j+=1
            if i+j==len(S):
                break
print(max_count)
Buggy code:
S=list(input())
A=[0]*10
c=0
for i in range(10):
  if S[i]=="A" or S[i]=="G" or S[i]=="C" or S[i]=="T":
    A[c]+=1
  else:
    c+=1
print(max(A))

Fixed code:
S=list(input())
A=[0]*10
c=0
for i in range(len(S)):
  if S[i]=="A" or S[i]=="G" or S[i]=="C" or S[i]=="T":
    A[c]+=1
  else:
    c+=1
print(max(A))
Buggy code:
s = list(input())
count = 0
m = 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:
    if m >count:
      m = count
      count == 0
print(m)

Fixed code:
s = list(input())
count = 0
m = 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:
    if m < count:
      m = count
      count = 0
    else:
      count = 0
if m < count:
      m = count
print(m)
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:
i=input()
n=len(i)

res=0
for i in range(n):
  for j in range(i,n):
    sub=s[i:j+1]
    flg=True
    for k in sub:
      if(k not in ['A','G','C','T']):
        flg=False
    if(flg):
      res=max(res,len(sub))
      
print(res)

Fixed code:
s=input()
n=len(s)
 
res=0
for i in range(n):
  for j in range(i,n):
    sub=s[i:j+1]
    flg=True
    for k in sub:
      if(k not in ['A','G','C','T']):
        flg=False
    if(flg):
      res=max(res,len(sub))
      
print(res)
Buggy code:
s = input()
x = 0
y = 0
for i in range(len(s)):
    if s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T':
        x += 1
    else:
        y = 0
    ans = max(y,x)
print(ans)


Fixed code:
s=input()
ans=0
p=0
for i in range(len(s)):
    if s[i]=='A' or s[i]=='T' or s[i]=='G' or s[i]=='C':
        p+=1
    else:
        ans=max(ans,p)
        p=0
ans=max(ans,p)
print(ans)
Buggy code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    S = lines.pop(0)
    c = 0
    res = 0
    for i in S:
        if i in 'AGCT':
            c += 1
        else:
            res = max(res, c)
            c = 0
    print(res)

lines = [x.strip() for x in sys.stdin.readlines()]


Fixed code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    S = lines.pop(0)
    c = 0
    res = 0
    for i in S:
        if i in 'AGCT':
            c += 1
        else:
            c = 0
        res = max(res, c)
    print(res)

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Buggy code:
s = list(input())
cnt = 0
list = []
for i in range(len(s)):
    if s[i] in ['A','C','G','T']:
        cnt += 1
    else:
        if cnt > 0:
            list.append(cnt)
            cnt = 0
if not cnt == 0:
    list.append(cnt)
max = max(list)
print(max)


Fixed code:
s = list(input())
cnt = 0
list = []
for i in range(len(s)):
    if s[i] in ['A','C','G','T']:
        cnt += 1
    else:
        if cnt > 0:
            list.append(cnt)
            cnt = 0
if not cnt == 0:
    list.append(cnt)
if len(list) == 0:
    list.append(0)
max = max(list)
print(max)
Buggy code:
L = ['A','C','G','T']
S = list(input()) 
S = ['1' if ((i in L) == True) else '0' for i in S]
S = ''.join(S_list)
S = S.split('0')
S = [len(i) for i in S]
print(max(S))

Fixed code:
L = ['A','C','G','T']
S = list(input()) 
S = ['1' if ((i in L) == True) else '0' for i in S]
S = ''.join(S)
S = S.split('0')
S = [len(i) for i in S]
print(max(S))
Buggy code:
S=str(input())
max_count = 0
count = 0
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'AT' or S[i] == 'G' or S[i] == 'C':
    count = count + 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(count)

Fixed code:
S=str(input())
max_count = 0
count = 0
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    count = count + 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(max_count)
Buggy code:
a=input()
count=0
s=0
for i in range(len(a)):
    if a[i]=='A' or a[i]=='C' or a[i]=='G' or a[i]=='T':
        count+=1
        s=count
    else:
        if count>s:
            s=count

        
        
        count=0
print(s)


Fixed code:
a=input()
count=0
s=0
for i in range(len(a)):
    if a[i]=='A' or a[i]=='T' or a[i]=='C' or a[i]=='G':
        count+=1
        if count>s:
            s=count
    else:
        count=0
print(s)
Buggy code:
s = list(input())
list = {"A","T","G","C"}
tmp = 0
count = 0
for i in s:
    if i not in list:
        if count > tmp:
            tmp = count
        count = 0
    count += 1
print(tmp)

Fixed code:
s = list(input())
list = {"A", "T", "G", "C"}
tmp = 0
count = 0
for i in s:
    count += 1
    if i not in list:
        if count -1 > tmp:
            tmp = count-1
        count = 0
if count > tmp:
    tmp = count
print(tmp)
Buggy code:
S = input()
ans = 0
ACGT = 0
for i in len(S):
  if S[i]=='A' or S[i]=='G' or A[i]=='C' or A[i]=='T':
    ACGT += 1
  else:
    ans = max(ans,ACGT)
    ACGT = 0
print(ans)

Fixed code:
S = input()
ans = 0
ACGT = 0
for i in range(len(S)):
  if S[i]=='A' or S[i]=='G' or S[i]=='C' or S[i]=='T':
    ACGT += 1
  else:
    ACGT = 0
  ans = max(ans,ACGT)
print(ans)
Buggy code:
# -*- coding: utf-8 -*-
import re
s = input()
target = re.sub('[^ACGT]', '@', s)
print(target)
num_list = []
for t in target.split('@'):
  num_list.append(len(t))
print(max(num_list))

Fixed code:
# -*- coding: utf-8 -*-
import re
s = input()
target = re.sub('[^ACGT]', '@', s)
num_list = []
for t in target.split('@'):
  num_list.append(len(t))
print(max(num_list))
Buggy code:
A = list(input())
S = ['A','C','G','T']
count = 0
a = []
a.append(count)
for i in A:
  if i in S:
    count += 1
    print(count)
    a.append(count)
  else:
    count = 0
print(max(a))

Fixed code:
A = list(input())
S = ['A','C','G','T']
count = 0
a = []
a.append(count)
for i in A:
  if i in S:
    count += 1
    a.append(count)
  else:
    count = 0
print(max(a))
Buggy code:
import re
import numpy as np
s = input()
s = 'ATKKLSGACKJMSA'
atgcs = re.split(r'[^ATGC]', s)
lens = np.array(list(map(len, atgcs))).max()
print(lens)


Fixed code:
import re
import numpy as np
s = input()
atgcs = re.split(r'[^ATGC]', s)
lens = np.array(list(map(len, atgcs))).max()
print(lens)
Buggy code:
S=input()
L=['A','C','G','T']
no=0
x=0
for i in S:
  if i in L:
    x+=1
  else:
    x=0
  ans=(x,no)
print(ans)

Fixed code:
S=input()
L=['A','C','G','T']
ans=0
x=0
for i in S:
  if i in L:
    x+=1
  else:
    x=0
  ans=max(x,ans)
print(ans)
Buggy code:

s = input()
ans = 0
for i in range(len(s)):
    count = 0
    for j in range(len(s)):
        if s[j] in "ACGT":
            count += 1
        else:
            break
    if count >= ans:
        ans = count
print(ans)



Fixed code:

s = input()
ans = 0
for i in range(len(s)):
    count = 0
    for j in range(i,len(s)):
        if s[j] in "ACGT":
            count += 1
        else:
            break
    if count >= ans:
        ans = count
print(ans)
Buggy code:

s = input()
n = len(s)
ans = 0
count = 0

for i in range(len(s)):
    for j in range(i,n):
        if all("ACGT".count(c) == 1 for c in s[i:j + 1]):
            ans = max(ans, j +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()
a=0
b=0
for i in range(len(s)):
  if s[i]=='A' or s[i]=='G' or s[i]=='C' or s[i]=='T':
    b+=1
    a=max(a,b)
print(a)

Fixed code:
s=input()
a=0
b=0
for i in range(len(s)):
  if s[i]=='A' or s[i]=='G' or s[i]=='C' or s[i]=='T':
    b+=1
    a=max(a,b)
  else:
    b=0
print(a)
Buggy code:
s="AAAAAAAAAA"

def sea(s):
    if s==[]:
        return 0
    max_agct=0
    tem_agct=0
    for i in range(len(s)):
        for j in range(len(s)-i):
            if s[i+j]=="A" or s[i+j]=="G" or s[i+j]=="C" or s[i+j]=="T":
                tem_agct+=1
          
                        
            else:
                if tem_agct>max_agct:
                    max_agct=tem_agct
                tem_agct=0
                break
                
        if i+j==len(s)-1:
            if tem_agct>max_agct:
                max_agct=tem_agct
            break
                    
    return max_agct

print(sea(s))
               

Fixed code:
s=list(input())

def sea(s):
    if s==[]:
        return 0
    max_agct=0
    tem_agct=0
    for i in range(len(s)):
        for j in range(len(s)-i):
            if s[i+j]=="A" or s[i+j]=="G" or s[i+j]=="C" or s[i+j]=="T":
                tem_agct+=1
          
                        
            else:
                if tem_agct>max_agct:
                    max_agct=tem_agct
                tem_agct=0
                break
                
        if i+j==len(s)-1:
            if tem_agct>max_agct:
                max_agct=tem_agct
            break
                    
    return max_agct

print(sea(s))
Buggy code:
S=input()

ans=0

for i in range(len(S)):
    tmp=0
    if S[i] in ("A","C","G","T"):
        tmp+=1
    else:
        ans=max(ans,tmp)
        tmp=0
print(ans)

Fixed code:
S=input()

ans=0
tmp=0
for i in range(len(S)):
    if S[i] in ("A","C","G","T"):
        tmp+=1
    else:
        ans=max(ans,tmp)
        tmp=0
ans=max(ans,tmp)
print(ans)
Buggy code:
s = input()
n = len(s)
for i in range(n):
    for j in range(i,n):
        if all("ATGC".cout(c) 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("ATGC".count(c) == 1 for c in s[i:j+1]):
            ans = max(ans,j - i + 1)
print(ans)
Buggy code:
import itertools
S = input()
L = len(S)

ans = 0
for i,j in itertools.combination(range(L),2):
  ss = S[i:j]
  ok = True
  for s in list(ss):
    if not(s == 'A' or s == 'C' or s == 'G' or s == 'T'):
      ok = False
      break
      
  if ok:
    ans = max(ans,j-i)
    
print(ans)
                                 



Fixed code:
import itertools
S = input()
L = len(S)

ans = 0
for i,j in itertools.combinations(range(L+1),2):
  ss = S[i:j]
  ok = True
  for s in list(ss):
    if not(s == 'A' or s == 'C' or s == 'G' or s == 'T'):
      ok = False
      break
      
  if ok:
    ans = max(ans,j-i)
    
print(ans)
Buggy code:
s = input()
a = 0
b = 0
for i in len(s):
    if i in 'ATGC':
        ans += 1
    else:
        b = max(a, b)
        a = 0
print(max(a, b))

Fixed code:
s = input()
a = 0
b = 0
for i in s:
    if i in 'ATGC':
        a += 1
    else:
        b = max(a, b)
        a = 0
print(max(a, b))