题解 | #DNA序列#
DNA序列
https://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
while 1: try: DNA_str = input() N = int(input()) mark = [[], []] for i in range(len(DNA_str) - N + 1): mark[0].append(DNA_str[i:i+N]) mark[1].append(mark[0][i].count('C') + mark[0][i].count('G')) print(mark[0][mark[1].index(max(mark[1]))]) except: break