题解 | #DNA序列#
DNA序列
https://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
a = input() b = int(input()) num_max = sum(1 if i in ['G','C'] else 0 for i in a[0:b]) num = num_max j = 0 for i in range(0, len(a)-b): num = num + (1 if a[i+b] in ['G','C'] else 0) - (1 if a[i] in ['G','C'] else 0) if num > num_max: num_max = num j = i + 1 print(a[j:j+b])