We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Bear and Steady Gene
You are viewing a single comment's thread. Return to all 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.