题解 | #DNA序列#
DNA序列
https://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
import sys
lines=sys.stdin.readlines()
g,n,d=lines[0],int(lines[1]),{}
for i in range(len(g)-n+1):
s=g[i:i+n]
GC=s.count('G')+s.count('C')
print(g[k:k+n])
lines=sys.stdin.readlines()
g,n,d=lines[0],int(lines[1]),{}
for i in range(len(g)-n+1):
s=g[i:i+n]
GC=s.count('G')+s.count('C')
d[i]=GC
# 最大值索引
k=max(d,key=d.get)print(g[k:k+n])