Python题解 | #DNA序列#
DNA序列
https://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
while True:
try:
s = input()
n = int(input())
str1 = ''
res = 0
ss = ''
for i in range(len(s) - n + 1):
str1 = s[i:i + n]
ans = 0
for j in str1:
if j == 'C' or j == 'G':
ans += 1
if ans / len(s) > res:
res = ans / len(s)
ss = str1
print(ss)
except:
break
