题解 | #DNA序列#
DNA序列
http://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
while True:
try:
DNA = input()
length = int(input())
max_counts = 0
max_DNA = []
for i in range(len(DNA)-length+1):
GC_counts = DNA.count('G',i,i+length) + DNA.count('C',i,i+length)
if GC_counts > max_counts:
max_counts = GC_counts
max_DNA = DNA[i:i+length]
print(max_DNA)
except:
break