mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
20 lines
352 B
Python
20 lines
352 B
Python
def problem_p03086(input_data):
|
|
import re
|
|
|
|
S = eval(input_data)
|
|
|
|
max = 0
|
|
|
|
for i in range(len(S)):
|
|
|
|
for j in range(i + 1, len(S) + 1):
|
|
|
|
pattern = re.compile(r"[A|T|C|G]{%d}" % int(j - i))
|
|
|
|
subStr = S[i:j]
|
|
|
|
if pattern.match(subStr) and j - i > max:
|
|
|
|
max = j - i
|
|
|
|
return max
|