题解 | #DNA序列#
DNA序列
https://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
string = input() n = int(input()) max_count = 0 result = '' for i in range(len(string) - n + 1): substring = string[i:i+n] count = 0 for char in substring: if char == "G" or char == "C": count += 1 if count > max_count: max_count = count result = substring print(result)