mkmeden's blog

By mkmeden, history, 2 years ago, In English

https://www.hackerrank.com/challenges/bear-and-steady-gene/problem

Can someone please explain why my code is not passing some test cases.

Code
  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Consider the case:

n = 12 gene = AAAACCCCGGGG

Your Code returns 3. But you need to replace at least one A, one C and one G. And the minimum substring that contains those three letters has length 6.