Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
"Works on my IDE" is not a kata issue. The problem is that you just have hardcoded two sample test cases. Your method should work with arbitrary DNA strings as input.
Non-timing out (i.e. correct) solution is still on 7 kyu level, so in case of this kata, it can.
Check how long your solution takes for 1000 tests with inputs of magnitude 2_000_000_000 when run locally, and if it's too slow, think how to improve it.
So far so good.
Now, there's 1000 tests of this magnitude.
How fast does your solution work for
n=2_000_000_000
?Please use the Spoiler flag when you post code. Other than that I'm pretty sure your code is wrong. Read the kata again: "...except numbers with a 5 in it." What would the range from 49 to 60 result in?