Bear and Steady Gene

  • + 0 comments

    newts: Let's say N == 40. This means that in final string you would need to have exactly 10 A, 10 C, 10 G and 10 T.

    Now let's say that you have 9 A, 11 C, 8 G, and 12 T in initial string. Then you would need to get rid of (convert) 1 C and 2 T. Since you can replace them with any other char, all you need to find - the shortest substring that has simultaneously 1 C and 2 T.