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

i=0
ans,temp=0,0
while(i<len(S)):
    if(S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C'):
        temp+=1
        ans=max(ans,temp)
    i+=1

print(ans)

Fixed code:
S=input()

i=0
ans,temp=0,0
while(i<len(S)):
    if(S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C'):
        temp+=1
        ans=max(ans,temp)
    else:
        temp=0
    i+=1

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

Fixed code:
S=input()
l=len(S)
ans=0
str='ACGT'
for i in range(l):
    for j in range(i,l):
        if all (str.count(x)==1 for x in S[i:j+1]):
            ans=max(ans,j-i+1)
print(ans)
Buggy code:
s=input()
ans=0
for i in s:
    if i in ["A","T","C","G"]:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
print(ans)

Fixed code:
s=input()
s+="Z"
ans=0
cnt=0
for i in s:
    if i in ["A","T","C","G"]:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
print(ans)
Buggy code:
s=[i for i in input()]
l=[]
cnt=0
for i in range(len(s)):
  if s[i] in {"A","T","C","G"," "}:
    cnt+=1
    if i==len(s)-1:
      l.append(cnt)
  else:
    l.append(cnt)
    cnt=0    

Fixed code:
s=[i for i in input()]
l=[]
cnt=0
for i in range(len(s)):
  if s[i] in {"A","T","C","G"," "}:
    cnt+=1
    if i==len(s)-1:
      l.append(cnt)
  else:
    l.append(cnt)
    cnt=0    
print(sorted(l)[-1])
Buggy code:
s = input()
max = 0
for i in range(len(s)):
  cnt = 0
  for j in range(i, len(s)):
    if(s[j] == 'A' or s[j] == 'C' or s[j] == 'G' or s[j] == 'T'):
      cnt += 1
    else:
      break
  if(max < cnt):
    max = cnt
print(cnt)

Fixed code:
s = input()
max = 0
for i in range(len(s)):
  cnt = 0
  for j in range(i, len(s)):
    if(s[j] == 'A' or s[j] == 'C' or s[j] == 'G' or s[j] == 'T'):
      cnt += 1
    else:
      break
  if(max < cnt):
    max = cnt
print(max)
Buggy code:
str = input()
ans = ''
tmp = ''
for s in str:
  if (s in ['A', 'T', 'G', 'C']):
    tmp += s
    if (len(tmp) > len(ans):
        ans = tmp
  else:
    tmp = ''

print(ans)
    

Fixed code:
str = list(input())

tmp = ''
ans = ''
for s in str:
  if (s in ['A', 'T', 'G', 'C']):
    tmp += s
    if (len(tmp) > len(ans)):
      ans = tmp
  else:
    tmp = ''

print(len(ans))
Buggy code:
s = list(input())
N = len(s)

ref = ["A","C","G","T"]
lst = []

for i in range(N):
    ans = ""
    if s[i] in ref:
        while s[i] in ref:
            ans = ans + s[i]
            i += 1
    lst.append(ans)

ans = -float("inf")
for i in range(N):
    ans = max(ans, len(lst[i]))

print(ans)

Fixed code:
s = list(input())
N = len(s)

ref = ["A","C","G","T"]
lst = []

for i in range(N):
    ans = ""
    if s[i] in ref:
        while s[i] in ref:
            ans = ans + s[i]
            i += 1
            if i >= N:
                break
    lst.append(ans)

ans = -float("inf")
for i in range(N):
    ans = max(ans, len(lst[i]))

print(ans)
Buggy code:
S = input()
N = len(S)
ans = 0
for i in range(N):
  for j in range(N):
    if all('ATGC'.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('ATGC'.count(c) == 1 for c in S[i:j+1]):
      ans = max(ans,j - i + 1)

      

      

print(ans)
Buggy code:
S = input()
ans = 0
now = 0
for i in S:
  if i in "ACGT":
    now += 1
  else:
    ans = max(now)
    now = 0
print(ans)

Fixed code:
S = input()
ans = 0
now = 0
for i in S:
  if i in "ACGT":
    now += 1
  else:
    ans = max(ans,now)
    now = 0
ans = max(ans,now)
print(ans)
Buggy code:
def makelist(n, m):
    return [[0 for i in range(m)] for j in range(n)]

acgt = ["A", "C", "G", "T"]
ans = 0
for c in input():
    if c in acgt:
        ans += 1
print(ans)


Fixed code:
def makelist(n, m):
    return [[0 for i in range(m)] for j in range(n)]

acgt = ["A", "C", "G", "T"]
ans = 0
cnt = 0
for c in input():
    if c in acgt:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans, cnt)
print(ans)
Buggy code:
import sys

arg = input()
scavenger=''
warehouse=[]
longest=0
i=0

for tmp in arg[0:]:
  if tmp=='A' | tmp=='T' | tmp=='C' | tmp=='G':
    scavenger=scavenger+tmp
  else:
    warehouse.append(scavenger)
    scavenger=''

for tmp in warehouse[0:]:
  if len(tmp)>longest:
    longest=len(tmp)

print(longest)

Fixed code:
import sys

arg = input()
scavenger=''
warehouse=[]
longest=0
i=0

for tmp in arg[0:]:
  if tmp=='A' or tmp=='T' or tmp=='C' or tmp=='G':
    scavenger=scavenger+tmp
  else:
    warehouse.append(scavenger)
    scavenger=''

warehouse.append(scavenger)

for tmp in warehouse[0:]:
  if len(tmp)>longest:
    longest=len(tmp)

print(longest)
Buggy code:
checklist=["A","C","G","T"]
sn = list(input())

answer = 0
count = 0
for s in sn :
  if s in checklist:
    count += 1
  else :
    answer = max(answer,count)
    count = 0

print(answer)
print(sn)

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

answer = 0
count = 0
for s in sn :
  if s in checklist:
    count += 1
  else :
    count = 0
  answer = max(answer,count)

print(answer)
Buggy code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

tmp = []
tmp.append(-1)
for i, x in enumerate(S):
	if x != "A" and x != "T" and x != "G" and x != "C":
		tmp.append(i)
tmp.append(len(S))
print(tmp)

tmp2 = [tmp[i+1] - tmp[i] for i in range(len(tmp)-1)]
print(max(tmp2)-1)


Fixed code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

tmp = []
tmp.append(-1)
for i, x in enumerate(S):
	if x != "A" and x != "T" and x != "G" and x != "C":
		tmp.append(i)
tmp.append(len(S))
#print(tmp)

tmp2 = [tmp[i+1] - tmp[i] for i in range(len(tmp)-1)]
print(max(tmp2)-1)
Buggy code:
S = list(input())
acgt = ['A', 'C', 'G', 'T']
lengths = []
l = 0
for x in S:
  if x in acgt:
    l += 1
  else:
    lengths.append(l)
    l = 0

if len(lengths)==0:
  lengths.append(l)

print(lengths)


Fixed code:
S = list(input())
acgt = ['A', 'C', 'G', 'T']
lengths = []
l = 0
for x in S:
  if x in acgt:
    l += 1
  else:
    lengths.append(l)
    l = 0

if len(lengths) == 0 or l > 0:
  lengths.append(l)

print(max(lengths))
Buggy code:
a = list(input())
b = 0
c = 0

for i in range(len(a)):
  if a[i] == "A":
    b = b + 1
  elif a[i] == "C":
    b = b + 1
  elif a[i] == "G":
    b = b + 1
  elif a[i] == "T":
    b = b + 1
  else :
    if c < b :
      c = b
      b = 0
    else :
      b = 0
if c < b :
      c = b
      b = 0
else :
      b = 0
print(b)     
print(c)

Fixed code:
a = list(input())
b = 0
c = 0

for i in range(len(a)):
  if a[i] == "A":
    b = b + 1
  elif a[i] == "C":
    b = b + 1
  elif a[i] == "G":
    b = b + 1
  elif a[i] == "T":
    b = b + 1
  else :
    if c < b :
      c = b
      b = 0
    else :
      b = 0
if c < b :
      c = b
      b = 0
else :
      b = 0
     
print(c)
Buggy code:
s=input()
l=['A','C','G','T']
ans=[];ct=0
for i in range(len(s)):
  if s[i] in l:
    ct+=1
  else:
    ans.append(ct)
ans.append(ct)
print(max(ans))

Fixed code:
s=input()
l=['A','C','G','T']
ans=[];ct=0
for i in range(len(s)):
  if s[i] in l:
    ct+=1
  else:
    ans.append(ct)
    ct=0
ans.append(ct)
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() == 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:
n = input()
li = []
count = 0
s = ""
for i in range(len(n)):
    if n[i] == "A" or n[i] == "G" or n[i] == "C" or n[i] == "T":
        s += "a"
    else:
        s += "b"
for i in range(len(n)):
    if s[i] == "a":
        count += 1
    else:
        li.append(count)
        count = 0
li.append(count)
print(max(li))
print(li)

Fixed code:
n = input()
li = []
count = 0
s = ""
for i in range(len(n)):
    if n[i] == "A" or n[i] == "G" or n[i] == "C" or n[i] == "T":
        s += "a"
    else:
        s += "b"
for i in range(len(n)):
    if s[i] == "a":
        count += 1
    else:
        li.append(count)
        count = 0
li.append(count)
print(max(li))
Buggy code:
s = list(input())
i=0
li = []
num = 0
while i<=len(s)-1:
    
    s1 = ["A","C","G","T"]
    
    if s[i] in s1 :
        num += 1
        i += 1
        li.append(num)
    elif s[i] not in s1 :
        num = 0
        i += 1
        
print(max(li))

Fixed code:
s = list(input())
i=0
li = [0]
num = 0
while i<=len(s)-1:
    
    s1 = ["A","C","G","T"]
    
    if s[i] in s1 :
        num += 1
        i += 1
        li.append(num)
    elif s[i] not in s1 :
        num = 0
        i += 1
        
print(max(li))
Buggy code:
s = list(input())

acgt = ['']
while len(s) != 0:
	if s[0] == 'A' or s[0] == 'C' or s[0] == 'G' or s[0] == 'T':
		acgt[0] += s.pop(0)
	else:
		s.pop(0)
		acgt.append('')

print(max([len(e) for e in acgt]))

Fixed code:
s = list(input())

acgt = ['']
while len(s) != 0:
	if s[0] == 'A' or s[0] == 'C' or s[0] == 'G' or s[0] == 'T':
		acgt[-1] += s.pop(0)
	else:
		s.pop(0)
		acgt.append('')

print(max([len(e) for e in acgt]))
Buggy code:
s = list(input())
l = len(s)
a=0
m=0
for i in range(l):
  if s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T':
    a+=1
  else:
    a = max(m, a)

print(a)

Fixed code:
s = list(input())
l = len(s)
a=0
m=0
for i in range(l):
  if s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T':
    a+=1
  else:
    a=0
  m = max(m, a)

print(m)
Buggy code:
a = input()
check = 'ACGT'
ans_list = []
for p in range(len(a)):
    for q in range(len(a)-1):
        
        count = 0
        for r in range(len(a[p:len(a)-q])):
            
            if a[p:len(a)-q][r] in check:
                count += 1
                if count == len(a[p:len(a)-q]):
                    ans_list.append(a[p:len(a)-q])
                    
                    break
ls =[]
for i in range(len(ans_list)):
    ls.append(len(ans_list[i]))

print(max(ls))

Fixed code:
a = input()
check = 'ACGT'
ans_list = []
for p in range(len(a)):
    for q in range(len(a)-1):
        
        count = 0
        for r in range(len(a[p:len(a)-q])):
            
            if a[p:len(a)-q][r] in check:
                count += 1
                if count == len(a[p:len(a)-q]):
                    ans_list.append(a[p:len(a)-q])
                    break
ls =[]
for i in range(len(ans_list)):
    ls.append(len(ans_list[i]))
if len(ls) == 0:
    if a[0] in check:
        print(1)
    else:
        print(0)
else:
    print(max(ls))
Buggy code:
S = input()
ans = 0

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

Fixed code:
S = input()
ans = 0

for i in range(len(S)):
  num = 0
  for j in range(i,len(S)):
    if S[j]=='A' or S[j]=='G' or S[j]=='C' or S[j]=='T':
      num += 1
    else:
      break
  ans = max(num, ans)
  
print(ans)
Buggy code:
s = list(input())

res = 0
max = 0
for i in s:
  if i == 'A' or i == 'T' or i == 'C' or i == 'G':
    res += 1
  elif max <res:
    max = res
    res = 0
  else:
    res = 0

if max < res:
  max = res
-
print(max)

Fixed code:
s = list(input())

res = 0
max = 0
for i in s:
  if i == 'A' or i == 'T' or i == 'C' or i == 'G':
    res += 1
  elif max <res:
    max = res
    res = 0
  else:
    res = 0

if max < res:
  max = res

print(max)
Buggy code:
s=input()
ans=0
tmp=0
acgt="ACGT"
for i in s:
  if i in acgt:
    ans=max(ans,tmp)
    tmp=0
  else:
    tmp+=1
ans=max(ans,tmp)
print(ans)

Fixed code:
s=input()
ans=0
tmp=0
acgt="ACGT"
for i in s:
  if i in acgt:
    tmp+=1
  else:
    ans=max(ans,tmp)
    tmp=0
ans=max(ans,tmp)
print(ans)
Buggy code:
S = input()
listS = list(S)
N = []
dic = ['A', 'T', 'G', 'C']
count = 0
for i in range(len(listS)):
    if listS[i] in dic:
        count += 1
        N.append(count)
    else:
        count = 0

print(max(N))

Fixed code:
S = input()
listS = list(S)
N = []
dic = ['A', 'T', 'G', 'C']
count = 0
for i in range(len(listS)):
    if listS[i] in dic:
        count += 1
        N.append(count)
    else:
        count = 0
        N.append(count)
print(max(N))
Buggy code:
S = str(input())
m =0
maxi = 0
for i in range(0,len(S)):
    if S[i] == 'A' or S[i] == 'G'or S[i] == 'C'or S[i] == 'T' :
        m = m + 1 
        maxi = max(maxi,m)
    else:
        m = 0
        maxi = maxi
    print(maxi)
print(maxi)



Fixed code:
S = str(input())
m =0
maxi = 0
for i in range(0,len(S)):
    if S[i] == 'A' or S[i] == 'G'or S[i] == 'C'or S[i] == 'T' :
        m = m + 1 
        maxi = max(maxi,m)
    else:
        m = 0
        maxi = maxi
print(maxi)
Buggy code:
from sys import stdin

S = stdin.readline().rstrip()
print(S)
countlist = []

count = 0
for s in S:
    print(s)
    if s == "A" or s == "C" or s == "G" or s == "T":
        count += 1
    else:
        countlist.append(count)
        count = 0
countlist.append(count)
print(max(countlist))

Fixed code:
from sys import stdin

S = stdin.readline().rstrip()
countlist = []

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

for i in range(len(S)):
    if S[i] in ACGT:
        cnt = 1
        for j in range(len(S) - i):
            if S[i+j+1] in ACGT:
                cnt += 1
            else:
                ans[i] = cnt
                break

print(max(ans))

Fixed code:
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = [0] * len(S)

for i in range(len(S)):
    if S[i] in ACGT:
        cnt = 1
        for j in range(len(S) - i - 1):
            if S[i+j+1] in ACGT:
                cnt += 1
            else:
                ans[i] = cnt
                break
        ans[i] = cnt

print(max(ans))
Buggy code:
# Coding-utf

S=list(map(str, input()))
lenth=0
max=0
print(S)
for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            lenth+=1
    else:
        if max<lenth:
            max=lenth
            lenth=0
        else:
            lenth=0
if lenth==len(S):
    max=lenth
    
print(max)


Fixed code:
# Coding-utf

S=list(map(str, input()))
lenth=0
max=0
for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            lenth+=1
    else:
        if max<lenth:
            max=lenth
            lenth=0
        else:
            lenth=0

if max<lenth:
    max=lenth

print(max)
Buggy code:
def main():
    s = input()
    acgt = set("ACGT")
    max_len = 0
    for i in range(len(s)+1):
        for j in range(i+1, len(s)+1):
            p = s[i:j]
            print(p)
            if set(p) <= acgt:
                max_len = max(len(p), max_len)
    print(max_len)


if __name__ == "__main__":
    main()




Fixed code:
def main():
    s = input()
    acgt = set("ACGT")
    max_len = 0
    for i in range(len(s)+1):
        for j in range(i+1, len(s)+1):
            p = s[i:j]
            if set(p) <= acgt:
                max_len = max(len(p), max_len)
    print(max_len)


if __name__ == "__main__":
    main()
Buggy code:
s=input()
l=len(s)
ans=0
for i in range(l):
  for j in range(1,l):
    t=s[i:i+j]
    for k in range(j):
      if t[k] not in ['A','C','G','T']:
        break
    else:
      ans=max(ans,j-i+1)
print(ans)

Fixed code:
s=input()
l=len(s)
ans=0
for i in range(l):
  for j in range(1,l-i+1):
    t=s[i:i+j]
    for k in range(j):
      if t[k]=='A' or t[k]=='C' or t[k]=='G' or t[k]=='T':
        continue
      else:
        break
    else:
      ans=max(ans,j)
print(ans)
Buggy code:
a = input()
num=0
b=[]
for i in a:
  if a[i] in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))
    

Fixed code:
a = input()+"a"
num=0
b=[]
for i in a:
  if i in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))
Buggy code:
s = input()
acgt = ['A', 'C', 'G', 'T']
ans = 0
for si in s:
    if si in acgt:
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
    #print(ans)
print(ans)

Fixed code:
s = input()
acgt = ['A', 'C', 'G', 'T']
ans = 0
cnt = 0
for si in s:
    if si in acgt:
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
    #print(ans)
print(ans)
Buggy code:
def main():
    s = input()

    ans = 0
    for i in range(len(s)):
        cur = 0
        for j in range(i,len(s)):
            if s[j] in {"A", "C", "G", "T"}:
                cur += 1
            else:
                break

            ans = max(cur, ans)


    print(ans)

Fixed code:
def main():
    s = input()

    ans = 0
    for i in range(len(s)):
        cur = 0
        for j in range(i,len(s)):
            if s[j] in {"A", "C", "G", "T"}:
                cur += 1

            else:
                break

            ans = max(cur, ans)


    print(ans)

if __name__ == '__main__':
    main()
Buggy code:
#coding: utf-8
S = input()
enki = ["A", "T", "G", "C"]
a = []
ans = ""
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
    else:
        ans = " "
    a.append(ans)
print(len(max(a)))

Fixed code:
#coding: utf-8
S = input()
enki = ["A", "T", "G", "C"]
a = []
ans = ""
max_ = 0
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
    else:
        ans = ""
    a.append(ans)
    max_ = max(max_, len(ans))
print(max_)
Buggy code:
s = list(input())
acgt = ['A', 'C', 'G', 'T']
cnt, ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if ans <= cnt:
      ans = cnt
  else:
    cnt = 0
print(ans)


Fixed code:
s = list(input())
acgt = ["A", "C", "G", "T"]
cnt = 0
ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if (ans < cnt):
      ans = cnt
  else:
    cnt = 0
print(ans)
Buggy code:
n = input()

ls = []
isnAGCT = False
cnt = 0
for i in range(len(n)):
  if n[i] == 'A' or n[i] == 'G' or n[i] == 'C' or n[i] == 'T':
    cnt += 1
    ls.append(cnt)
  else:
    cnt = 0
    
print(max(ls))

Fixed code:
n = input()

ls = []
cnt = 0
for i in range(len(n)):
  if n[i] == 'A' or n[i] == 'G' or n[i] == 'C' or n[i] == 'T':
    cnt += 1
    ls.append(cnt)
  else:
    cnt = 0
    ls.append(cnt)
    
print(max(ls))
Buggy code:
s = input()
count = 0
lens = []

for i, _ in enumerate(s):
  for c in s[i:]:
    if c in ['A', 'G', 'C', 'T']:
      count += 1
  	else:
      break
  lens.append(count)
  count = 0
  
print(max(lens))
  

Fixed code:
s = input()
count = 0
lens = []

for i, _ in enumerate(s):
  for c in s[i:]:
    if c in ['A', 'G', 'C', 'T']:
      count += 1
    else:
      break
  lens.append(count)
  count = 0
  
print(max(lens))
Buggy code:
s = input()
n = len(s)
dp = [0 for i in range(n+1)]
for i in range(n):
    res = 0
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
        res = 1
    dp[i+1] = dp[i]+res
print(dp[n])

Fixed code:
s = input()
n = len(s)
dp = [0 for i in range(n+1)]
for i in range(n):
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'T' or s[i] == 'G':
        dp[i+1] = dp[i] + 1
print(max(dp))
Buggy code:
S = str(input())
n = len(S)
L = ["A","C","G","T"]
w = [0]
for i in range(n):
    if S[i] in L:
        cnt = 0
        for j in range(i,n):
            if S[j] not in L:
                cnt += 1
                w.append(len(S[i:j]))
        if cnt == 0:
            w.append(len(S[i::]))
print(max(w))

Fixed code:
S = str(input())
n = len(S)
L = ["A","C","G","T"]
w = [0]
for i in range(n):
    if S[i] in L:
        cnt = 0
        for j in range(i,n):
            if S[j] not in L:
                cnt += 1
                w.append(len(S[i:j]))
                break
        if cnt == 0:
            w.append(len(S[i::]))
print(max(w))
Buggy code:
S = input()
RES = 0

def countACGT(s):
  res = 0
  res += s.count("A")
  res += s.count("C")
  res += s.count("G")
  res += s.count("T")
  return res

for i in range(len(S)+1):
  for j in range(len(S)+1):
    RES = max(RES,countACGT(S[i:j]))
print(RES)

Fixed code:
S = input()
RES = 0

def countACGT(s):
  res = 0
  res += s.count("A")
  res += s.count("C")
  res += s.count("G")
  res += s.count("T")
  if res == len(s):
    return res
  else:
    return 0

for i in range(len(S)+1):
  for j in range(len(S)+1):
    RES = max(RES,countACGT(S[i:j]))
print(RES)
Buggy code:
s=input()
ACGT=["A","C","G","T"]
moji=[]
for i in range(len(s)):
    #print(moji)
    if s[i] in ACGT:
        moji.append(s[i])
        for j in range(i+1,len(s)):
            if s[j] in ACGT:
                moji[i]+=s[j]
            else:
                break
    else:
        moji.append("?")
index=0
for i in moji:
    moji[index]=len(i)
    index+=1
print(max(moji))



Fixed code:
s=input()
ACGT=["A","C","G","T"]
moji=[]
for i in range(len(s)):
    #print(moji)
    if s[i] in ACGT:
        moji.append(s[i])
        for j in range(i+1,len(s)):
            if s[j] in ACGT:
                moji[i]+=s[j]
            else:
                break
    else:
        moji.append("")
index=0
for i in moji:
    moji[index]=len(i)
    index+=1
print(max(moji))
Buggy code:
S = input()
max = 0
count = 0
for x in S :
    if x in "ATGC" :
        count += 1
    else :
        max = max(max, count)
        count = 0
max = max(max, count)
print(max)


Fixed code:
S = input()
mx = 0
count = 0
for x in S :
    if x in "ATGC" :
        count += 1
    else :
        mx = max(mx, count)
        count = 0
mx = max(mx, count)
print(mx)
Buggy code:
s = input()

MAX = 0
m = 0
for i in s:
  print(m)
  if i == "A" or i == "G" or i == "C" or i == "T":
    m += 1
    MAX = max(MAX,m)
  else:
    m = 0


Fixed code:
s = input()

MAX = 0
m = 0
for i in s:
  if i == "A" or i == "G" or i == "C" or i == "T":
    m += 1
    MAX = max(MAX,m)
  else:
    m = 0
print(MAX)
Buggy code:
import re

S=input()

ss = re.sub('[^A, T, C, G]', ',', S)
sss = ss.split(',')
ans = ""
for i in sss:
  if len(ans) < len(i):
    ans = i
print(ans)

Fixed code:
import re

S=input()

ss = re.sub('[^A, T, C, G]', ',', S)
sss = ss.split(',')
ans = ""
for i in sss:
  if len(ans) < len(i):
    ans = i
print(len(ans))