TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input()
count = 0
max_count = 0
for c in s:
  if c in ['A','C','G','T']:
    count = 0
  else:
    count += 1
    if max_count < count:
      max_count = count
print(max_count)


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)

s = input()

counter = 0
max_counter = 0
for c in s:
    if c in 'ACGT':
        counter += 1
    else:
        counter = 0
    if max_counter < counter:
        max_counter = counter
print(max_counter)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s=input()
S=[s[i] for i in range(len(s))]
A={'A','C','G','T'}
B=[S[i] in A for i in range(len(S))]
max_length=0

for i in range(len(B)):
  if B[i]==1:
    count_length=1
    count=i
    max_length=count_length
    while (count+1)<len(B) and B[count+1]==1:
      count_length=1+count_length
      count=1+count
      max_length=max(max_length,count_length)
      
print(max_length)

s=input()
S=[s[i] for i in range(len(s))]
A={'A','C','G','T'}
B=[S[i] in A for i in range(len(S))]
max_length=0
print(B)
for i in range(len(B)):
  if B[i]==1:
    count_length=1
    count=i
    max_length=max(count_length,max_length)
    while (count+1)<len(B) and B[count+1]==1:
      count_length=1+count_length
      count=1+count
      max_length=max(max_length,count_length)
      
print(max_length)

s=input()
S=[s[i] for i in range(len(s))]
A={'A','C','G','T'}
B=[S[i] in A for i in range(len(S))]
max_length=0
print(B)
for i in range(len(B)):
  if B[i]==1:
    count_length=1
    count=i
    while (count+1)<len(B) and B[count+1]==1:
      count_length=1+count_length
      count=1+count
      max_length=max(max_length,count_length)
    max_length=max(max_length,1)
      
print(max_length)

s=input()
S=[s[i] for i in range(len(s))]
A={'A','C','G','T'}
B=[S[i] in A for i in range(len(S))]
max_length=0
for i in range(len(B)):
  if B[i]==1:
    count_length=1
    count=i
    while (count+1)<len(B) and B[count+1]==1:
      count_length=1+count_length
      count=1+count
      max_length=max(max_length,count_length)
    max_length=max(max_length,1)
      
print(max_length)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input()
ml = 0
nc = 0
for c in s:
    if c in "ACGT": 
        nc += 1
    else:
        ml = max(ml, nc)
        nc = 0


s = input()
ml = 0
nc = 0
for c in s:
    if c in "ACGT": 
        nc += 1
    else:
        ml = max(ml, nc)
        nc = 0
ml = max(ml, nc)
print(ml)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)

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(-1)        
if L[-1]==-1:
    P=0
else:
    P = len(str(max(L)))
print(P)

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)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)




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)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
def checkACGT(s):
    ss = ''.join(s)
    check = ss.replace('A', '').replace('C', '')\
    .replace('G','').replace('T', '')
    if len(check) == 0:
        print(ss)
        return True

    else:
        return False


s = input()
ans = 0
for i in range(len(s)):
    for j in range(i, len(s)):
        ss = s[i:j + i]
        # print(ss)
        if (checkACGT(ss)):
            ans = max(ans, len(ss))
print(ans)


def checkACGT(s):
    ss = ''.join(s)
    check = ss.replace('A', '').replace('C', '')\
    .replace('G','').replace('T', '')
    if len(check) == 0:
        return True
    else:
        return False


s = input()
ans = 0
for i in range(len(s)):
    for j in range(len(s) - i + 1):
        ss = s[i:j + i]
        # print(ss)
        if (checkACGT(ss)):
            ans = max(ans, len(ss))
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s =input()
l =len(s)
count=0
for i in range(l):
    x =s[i]
    if x =='A' or x =='C' or x =='G' or x =='T':
        count +=1
        for j in range(i+1, l):
            x =s[j]
            if x =='A' or x =='C' or x =='G' or x =='T':
                count +=1
            else:
                break

print(count)


s = input()
s_x = s+"X"
list_s = ["A","C","T","G"]
ans = []
count=0
for i in s_x:
    #print(i)
    if i in list_s:
        count+=1
    else:
        ans.append(count)
        count=0

print(max(ans))


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
S = input()
 
num = 0
count = 0
lis = ["A", "G", "C", "T"]
for s in S:
  if s not in lis:
  	count += 1
  else:
    if num < count:
      num = count
    count = 0
print(num)

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

print(max(count))

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)


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)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
lngs = input()

ACGT = ["A", "C", "G", "T"]
out_list = []
out_list_long = []

for lng in lngs:
    if lng in ACGT:
        out_list += lng
    else:
        if len(out_list) > len(out_list_long):
            out_list_long = out_list
        out_list = []
        
    
out = ''.join(out_list_long)
print(out)

lngs = input()

ACGT = ["A", "C", "G", "T"]
out_list = []

for lng in lngs:
    if lng in ACGT:
        out_list += lng
out = ''.join(out_list)
print(out)

lngs = input()

ACGT = ["A", "C", "G", "T"]
out_list = []
out_list_long = []


for lng in lngs:

    if lng in ACGT:
        out_list += lng
    else:
        if len(out_list) > len(out_list_long):
            out_list_long = []
            out_list_long = out_list
        out_list = []

if len(out_list) > len(out_list_long):
    out_list_long = []
    out_list_long = out_list

print(len(out_list_long))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
import sys
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
S = read()
count=0
cnt_max=0
for i in range(len(S)):
  if S[i] in ['A', 'C', 'G', 'T']:
    count +=1
  else:
    cnt_max = max(cnt_max,count)
    count=0
print(cnt_max)
  

import sys
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
S = read().decode('utf-8')
count=0
cnt_max=0
for i in range(len(S)):
  if S[i] in ['A', 'C', 'G', 'T']:
    count +=1
  else:
    cnt_max = max(cnt_max,count)
    count=0
print(cnt_max)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)

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
print(m)

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)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
import numpy as np
inp = input()
ACGT = ["", "A", "C", "G", "T"]
sentences = [i+j+k+l+m+n+o+p+q+r+s for i in ACGT for j in ACGT for k in ACGT for l in ACGT for m in ACGT for n in ACGT for o in ACGT for p in ACGT for q in ACGT for r in ACGT for s in ACGT]
length = [len(sent) for sent in sentences if sent in inp]
print(np.max(length))

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)

import numpy as np
inp = input()
ACGT = ["", "A", "C", "G", "T"]
sentences = [j+K+m+n for j in ACGT for k in ACGT for m in ACGT for n in ACGT]
length = [len(sent) for sent in sentences if sent in inp]
print(np.max(length))

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)

Verdicts: Time Limit Exceeded

Runtime Error

Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start )
  start = right
print(ans)

S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while start < length and S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start)
  start = right
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
b = input()
c = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
print (c[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)


Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
S = input()

target = list('ACGT')

count_list = [0] * len(S)
for i in range(len(S)):
    if S[i] in target:
        count_list[i] = 1

max_length = 0
for start in range(len(S)):
    if count_list[start] == 0:
        continue
    for end in range(start, len(S)):
        if count_list[end] == 0:
            break
        
        print(count_list[start : end+1])
        max_length = max(sum(count_list[start : end+1]), max_length)

print(max_length)

target = 'ACGT'
S = input()

answer = 0
for start in range(len(S)):
    if S[start] not in target:
        continue
    count = 0
    for end in range(start, len(S)):
        if S[end] not in target:
            break
        count += 1
    
    answer = max(answer, count)

print(answer)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input()
l = 0
l_max = 0
for i in range(len(s)):
  b = S[i]
  if b == 'A' or b == 'C' or b == 'T' or b == 'G':
    l += 1
  else:
    l_max = max(l_max,l)
    l = 0
print(l_max)

s = input()
l = 0
l_max = 0
for i in range(len(s)):
  b = s[i]
  if b == 'A' or b == 'C' or b == 'T' or b == 'G':
    l += 1
  else:
    l_max = max(l_max,l)
    l = 0
l_max = max(l_max,l)
print(l_max)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)


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)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):

S=str(input())
Slist=list(S)
Slen=len(Slist)
MAX=0
for i in range(Slen):
    for j in range(Slen-i-1):
        J=j+i+1
        karis=Slist[i:J+1]
        flag = 0
        print(karis)
        for x in karis:
            if x == "A" or x == "T" or x == "C" or x == "G":
                pass
            else:
                flag = 1
                break
        if flag == 0:
            MAX=max(MAX,len(karis))
if MAX == 0:
    if "A" in S or "T" in S or "G" in S or "C" in S:
        print(1)
    else:
        print(0)
else:
    print(MAX)


S=str(input())
Slist=list(S)
Slen=len(Slist)
MAX=0
for i in range(Slen):
    for j in range(Slen-i-1):
        J=j+i+1
        karis=Slist[i:J+1]
        flag = 0
        for x in karis:
            if x == "A" or x == "T" or x == "C" or x == "G":
                pass
            else:
                flag = 1
                break
        if flag == 0:
            MAX=max(MAX,len(karis))
if MAX == 0:
    if "A" in S or "T" in S or "G" in S or "C" in S:
        print(1)
    else:
        print(0)
else:
    print(MAX)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

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


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


Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s=input()
x=['A','T','C','G']
a=[0]*len(s)
a[0]=1 if s[0] in x
for i in range(1,len(s)):
  if s[i] in x:
    a[i]=a[i-1]+1
print(max(a))
  
  

s=input()
x=['A','T','C','G']
a=[0]*len(s)
if s[0] in x:
  a[0]=1
for i in range(1,len(s)):
  if s[i] in x:
    a[i]=a[i-1]+1
print(max(a))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
string = input()
acgt = ['A', 'C', 'G', 'T']

max_length_str = ''
tmp_str = ''
for n in string:
  if n in acgt:
    tmp_str += n
  else:
    if len(tmp_str) > len(max_length_str):
      max_length_str = tmp_str
      tmp_str = ''

print(max_length_str)
  

string = input()
acgt = ['A', 'C', 'G', 'T']

max_length_str = ''
tmp_str = ''
for n in string:
  if n in acgt:
    tmp_str += n
  else:
    if len(tmp_str) > len(max_length_str):
      max_length_str = tmp_str
      tmp_str = ''

if len(tmp_str) > len(max_length_str):
  max_length_str = tmp_str
  tmp_str = ''

print(len(max_length_str))


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input() + 'n'
ans = 0
fans = 0
for i in range(len(s)):
    if s[i] 'ACGT':
        ans += 1
    elif fans < ans:
        fans = ans
        ans = 0
print(fans)


s = input() + 'n'
ans = 0
fans = 0
for i in range(len(s)):
    if s[i] in 'ACGT':
        ans += 1
    elif fans < ans:
        fans = ans
        ans = 0
print(fans)


Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input()
s = "ATCHATTTKGTCC"
count = 0
ans = 0
for i in s:
    if i == "A":
        count += 1
    elif i == "C":
        count += 1
    elif i == "G":
        count += 1
    elif i == "T":
        count += 1
    else:
        if ans <= count:
            ans = count
        count = 0
print(ans)


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)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s=input()
n=len(s)
ans=0
for i in range(n):
  for i in range(i,n)
  bubun=s[i:j+1]
  flag=True
  for c in bubun:
    if(c not in ['A','G','C','T']):
      flag = False
  if(flag):
    ans = max(ans,len(bubun))
print(ans)

s=input()
n=len(s)
ans=0
for i in range(n):
    for j in range(i,n):
        bubun=s[i:j+1]
        flag=True
        for c in bubun:
            if(c not in ['A','G','C','T']):
            flag = False
        if(flag):
            ans = max(ans,len(bubun))
print(ans)


s=input()
n=len(s)
ans=0
for i in range(n):
    for j in range(i,n):
        bubun=s[i:j+1]
        flag=True
        for c in bubun:
            if(c not in ['A','G','C','T']):
            flag = False
        if(flag):
                  ans = max(ans,len(bubun))
print(ans)


s=input()
n=len(s)
ans=0
for i in range(n):
  for j in range(i,n):
  bubun=s[i:j+1]
  flag=True
  for c in bubun:
    if(c not in ['A','G','C','T']):
      flag = False
  if(flag):
    ans = max(ans,len(bubun))
print(ans)


s=input()
n=len(s)
ans=0
for i in range(n):
  for j in range(i,n)
  bubun=s[i:j+1]
  flag=True
  for c in bubun:
    if(c not in ['A','G','C','T']):
      flag = False
  if(flag):
    ans = max(ans,len(bubun))
print(ans)


s=input()
n=len(s)
ans=0
for i in range(n):
  for j in range(i,n):
      bubun=s[i:j+1]
      flag=True
      for c in bubun:
          if(c not in ['A','G','C','T']):
          flag = False
      if(flag):
        ans = max(ans,len(bubun))
print(ans)


s=input()
n=len(s)
ans=0
for i in range(n):
    for j in range(i,n):
        bubun=s[i:j+1]
        flag=True
        for c in bubun:
            if(c not in ['A','G','C','T']):
            flag = False
        if(flag):
            ans = max(ans,len(bubun))
print(ans)


s=input()
n=len(s)
ans=0
for i in range(n):
    for j in range(i,n):
        bubun=s[i:j+1]
        flag=True
        for c in bubun:
            if(c not in ['A','G','C','T']):flag = False
        if(flag):ans = max(ans,len(bubun))
print(ans)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
S = input()
N = len(S)
count = 0
max = 0
for i in range (N):
  if S[i] == "A" or "T" or "G" or "C":
    count = count + 1
  else:
    if count > max:
      max = count
    count = 0
if count > max:
  max = count
  
print(max)

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



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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input()
s = s.translate(str.maketrans({'T': 'A', 'G': 'A', 'C': 'A'}))
print(s)
s = list(s)+['END']

if s[0] == 'A':
    counter = 1
else:
    counter = 0

ans = 0

for i in range(len(s)):
    if s[i - 1] == s[i] == 'A':
        counter += 1
    else:
        if ans < counter:
            ans = counter
        if s[i] == 'A':
            counter = 1
        else:
            counter = 0
print(ans)


s = input()
s = s.translate(str.maketrans({'T': 'A', 'G': 'A', 'C': 'A'}))
s = list(s)+['END']

if s[0] == 'A':
    counter = 1
else:
    counter = 0

ans = 0

for i in range(len(s)):
    if s[i - 1] == s[i] == 'A':
        counter += 1
    else:
        if ans < counter:
            ans = counter
        if s[i] == 'A':
            counter = 1
        else:
            counter = 0
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):

S = input()
k = []
b = ["A","C","G","T"]
a = 1

for i in range(len(S)):
    
    
    if S[i] in b:
        if i == len(S)-1:
            k.append(a)
            break
        else:
        
          for  j in range(1,len(S)-1):
              if S[i+j] in b:
                  if i+j == len(S)-1:
                      k.append(a)
                      a = 1
                      break
                  else:
                      a += 1
              else:
                  k.append(a)
                  a = 1
                  break
    else:
        if i == len(S)-1:
            break
print(k)
if len(k) == 0:
    print(0)
else:
    print(max(k))



S = input()
k = []
b = ["A","C","G","T"]
a = 1

for i in range(len(S)):
    
    
    if S[i] in b:
        if i == len(S)-1:
            k.append(a)
            break
        else:
          for  j in range(1,len(S)-1):
              if S[i+j] in b:
                  if i+j == len(S)-1:
                      a += 1
                      k.append(a)
                      a = 1
                      print(k)
                      break
                  else:
                      a += 1
                      print(a)
              else:
                  k.append(a)
                  a = 1
                  print(k)
                  break
    else:
        if i == len(S)-1:
            break
if len(k) == 0:
    print(0)
else:
    print(max(k))


S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
k.append(now)
if len(k) == 0:
    print(0)
else:
    print(max(k))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
print(len(input().replace("A","").replace("G","").replace("C","").replace("T","")))


S = input()

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


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)


s = input()
start = 0
i = 0
ans = 0
for i in range(len(s)):
    if s[i] in ['A', 'C', 'G', 'T']:
        continue
    else:
        ans = max(ans, i - start)
        start = i + 1
ans = max(ans, len(s) - start)
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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]):
            s = max(ans, j - i + 1)
print(ans)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
import sys

b = input()

flg = 0
n = 0
nw = []
for bi in b:
    if bi == ("A" or "G" or "C" or "T"):
        flg = 1
        n += 1
    else:
        flg = 0
        n = 0
    nw.append(n)

nw.sort(reverse = True)
print(nw[0])





import sys

b = input()

flg = 0
n = 0
nw = []
for bi in b:
    if bi == 'A' or bi == 'G' or bi == 'C' or bi == 'T':
        flg = 1
        n += 1
    else:
        flg = 0
        n = 0
    nw.append(n)

nw.sort(reverse = True)
print(nw[0])




Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s =  list(input())
ans = []
for mozi in s:
    if(mozi == "A" or mozi == "G" or mozi == "C" or mozi == "T"):
        ans.append(mozi)
    else:
        break
print("".join(ans))

s =  list(input())
combo = False
cnt = 0
ans = [0,] 
for mozi in s:
    if(mozi == "A" or mozi == "G" or mozi == "C" or mozi == "T"):
        cnt = cnt + 1 
        if combo != True:
            combo = True
    else:
        if combo:
            ans.append(cnt)
            cnt = 0
            combo = False
ans.append(cnt)
print(max(ans))


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input()

max_count = 0
count = 0
for i in range(len(s)):
    if s[i] in ['A', 'C', 'G', 'T']:
        count += 1
    else:
        if count > max_count:
            max_count = count
    count = 0

print(max_count)


import sys
# input = sys.stdin.readline

def readlines(n):
    for _ in range(n):
        yield map(int, input().split())


def main():
    s = input()

    subst = 0
    for i in range(len(s)):
        if s[i] in "ACGT":
            subst += 1
        else:
            yield subst
            subst = 0
    
    yield subst
    

print(max(main()))


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = str(input())
count = 0
count_max = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        count += 1
    else:
        if count_max < count:
            count_max = count
            count = 0

count_max = count

print(count_max)

s = str(input())
#s = 'ATCODER'

count = 0
count_max = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        count += 1
    else:
        if count_max < count:
            count_max = count
            count = 0

if count_max < count:
    count_max = count

print(count_max)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
S = input()
count = 0
list = []

for c in S:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    count+=1
  else:
    list.append(count)
    count = 0

if not list:
    print(0)
else
    print(max(list))
    

S = input()
count = 0
list = []

for c in S:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    count+=1
  else:
    list.append(count)
    count = 0

if if len(list)==0:
    print(0)
else:
    print(max(list))

S = input()
count = 0
list = []

for c in S:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    count++
  else:
    list.append(count)
    count = 0
print(max(list))
    

S = input()
count = 0
list = []

for c in S:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    count+=1
  else:
    list.append(count)
    count = 0
list.append(count)

if len(list)==0:
    print('0')
else:
    print(max(list))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input()
m = 0
l = 0
for c in s:
    if not (c == 'A' or c == 'C' or c == 'G' or c == 'T'):
        m = max(m, l)
        l = 0
        continue

    l += 1

print(l)

s = input()
m = 0
l = 0
for c in s:
    if not (c == 'A' or c == 'C' or c == 'G' or c == 'T'):
        m = max(m, l)
        l = 0
        continue

    l += 1

m = max(m, l)
print(m)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
import sys

def main():
    S = input()
    l = len(S)
    
    cnt_l = []
    
    for i in range(l):
        cnt = 0
        for j in range(l-i):
            if str(S[i+j]) in ['A', 'C', 'G', 'T']:
                cnt += 1
            else:
                cnt_l.append(cnt)

    m = max(cnt_l)
    m_index = cnt_l.index(m)
    m_l = m + m_index
    out = S[m_index:m_l]

    print(out)
main()

import sys

def main():
    S = input()
    l = len(S)
    
    cnt_l = []
    
    for i in range(l):
        cnt = 0
        for j in range(l-i):
            if str(S[i+j]) in ['A', 'C', 'G', 'T']:
                cnt += 1
            else:
                cnt_l.append(cnt)

    m = max(cnt_l)
    if m==0:
        out = 0
    else:
        m_index = cnt_l.index(m)
        m_l = m + m_index
        out = S[m_index:m_l]

    print(out)
main()

import sys
 
def main():
    S = input()
    l = len(S)
    
    cnt_l = []
    
    for i in range(l):
        cnt = 0
        for j in range(l-i):
            if str(S[i+j]) in ['A', 'C', 'G', 'T']:
                cnt += 1
            else:
                cnt_l.append(cnt)
 
    m = max(cnt_l)
 
    print(out)
main()

import sys

def main():
    S = input()
    l = len(S)
    
    ans = 0
    for i in range(l):
        for j in range(i, l):
            if all(['ATGC'.count(c) == 1 for c in S[i:j+1]]):
                ans = max(ans, j-i+1)
            
    print(ans)
main()

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
# -*- 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()]


# -*- 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)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)


import itertools,sys
def S(): return sys.stdin.readline().rstrip()
S = S()
ans = 0
for i,j in itertools.combinations_with_replacement(range(len(S)),2):
    if all([x in 'ACGT' for x in S[i:j+1]]):
        ans = max(ans,j+1-i)
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
import re

data = input().upper()

text = re.sub('[ACGT]+', "", data)

print(len(text))


import re

data = input()

t = re.split('[^ACGT]+', data)
t.sort(key=len, reverse=True)
print(len(t[0]))

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
N=list(input())
print(N)
count = 0
Scount = 0

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

print(Scount)

N=list(input())
count = 0
Scount = 0

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

print(Scount)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
S=input()
N=len(S)
ans=0
d=set(list("AGCT"))

for i in range(N+1):
    for j in range(N+1):
        s=S[i:j]
        print(s)
        if set(list(s))<=d:
            ans=max(ans,len(s))
            
print(ans)

S=input()
N=len(S)
ans=0
d=set(list("AGCT"))

for i in range(N+1):
    for j in range(N+1):
        s=S[i:j]
        if set(list(s))<=d:
            ans=max(ans,len(s))
            
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
S = list(input())
ans = 0
count = 0
for i in len(S):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        count += 1
    else:
        if ans < count:
            ans = count
        else:
            pass
        count = 0
print(ans)

S = list(input())
ans = 0
count = 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 ans < count:
            ans = count
        else:
            pass
        count = 0
if ans < count:
    ans = count
else:
    pass
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 20:27:19 2019

@author: screamLab
"""

s = input()
atcg = ['A','T','C','G']
ans = 0
long = 0
for i in range(len(s)):
    if s[i] in atcg:
        if s[i+1] in atcg:
            ans += 1
        else:
            ans += 1
    long = max(long,ans)
    ans = 0
long = max(long,ans)
print(long)
        

# -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 20:27:19 2019

@author: screamLab
"""

s = input()
s += 'H'
atcg = ['A','T','C','G']
ans = 0
long = 0
for i in range(len(s)):
    if s[i] in atcg:
        if i == len(s):
            break
        if s[i+1] in atcg:
            ans += 1
        else:
            ans += 1
            long = max(long,ans)
            ans = 0
long = max(long,ans)
print(long)
        

Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
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)

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)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s=input()
word=list(s)
temp=[]
score=[]
for i in range(len(word)):
  if word[i]!='A' and word[i]!='C' and word[i]!='G' and word[i]!='T':
    temp.append(i+1)
if word[0]=='A' or word[0]=='C' or word[0]=='G' or word[0]=='T':
  temp.insert(0,0)
if word[-1]=='A' or word[-1]=='C' or word[-1]=='G' or word[-1]=='T':
  temp.append(len(word)+1)
print(temp)
for i in range(len(temp)-1):
  if temp[i]==0 or temp[i+1]==len(word)+1:
    score.append(temp[i+1]-temp[i]-1)
  else:
    score.append(temp[i+1]-temp[i]-1)
print(max(score))

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)


Verdicts: Runtime Error

Accepted