题解 | #DNA序列#
DNA序列
https://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
s = input() N = int(input()) ls = [] for i in range(0,len(s)): ls.append(s[i:i+N]) #print(ls) lst = [] for i in ls: if len(i) == N: lst.append(i) #print(lst) ld = [] for i in lst: ld.append((i.count('G')+i.count('C'))/len(i)) print(lst[ld.index(max(ld))])