Table of contents
topic
A DNA sequence is composed of four letters A/C/G/T. The ratio of G and C (defined as GC-Ratio) is the total number of occurrences of the two letters G and C in the sequence divided by the total number of letters (that is, the sequence length). In genetic engineering, this ratio is very important. Because the high GC-Ratio may be the starting point of the gene.
Given a very long DNA sequence and a limited substring length N, please help researchers find the first substring with the highest GC-Ratio and length N in the given DNA sequence from left to right.
The substrings with DNA sequence ACGT are: ACG , CG , CGT etc., but no AGT , CT etc.Data range: the string length satisfies 1≤n≤1000, and the input string only contains A/C/G/T letters
Input description:
input a string-type gene sequence, and the length of an int-type substringOutput description:
Find the substring with the highest GC ratio, if there are more than one, output the first substringExample 1:
Enter