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.
Your code is poorly designed not a Kata.
But you do not pass all tests. You pass tests up to some point, but not all tests, because you run out of time.
@GrimLoch, based on your profile, you did not solve yet any purple (1 kyu or 2 kyu) kata, so your point (of "I've easily solved 2 kyu katas ") does not make too much sense. This is a difficult problem, I personally did not solve it yet, and you need an optimized algorithm. If your algorithm doesn't pass the tests in less that 12 seconds (not only one test, but all tests), it means it is not fast enough for this level and you may need to further optimize it or to come up with a better solution. But no, the fact that you can't solve the problem does not mean that the author of the kata is an amateur or that the kata is broken. Also, not solving a kata does not mean that you lose honor. It only means that you don't get additional honor.
What even is your point? You made no sense in your argument.
You're saying that just because codewars limit test run to 12 second, meaning that the kata creators are amateurs because they create a kata that needs such complex algorithm in an environment with limited time?
No, it's not being amateur. It's the opposite, creating a complex algorithm using math to create such fast-processing function for bigger inputs.
If you're saying that the kata creator is amateur for doing that, what are you gonna call the coding olympiads winners (who deal with harder problems, on the spot, with bigger inputs and more strict time limit)? A doodoo head?
Also, you say that you pass it on the sample test cases? Haha, well everybody could. Just hard-code 'em. It'll pass the sample cases since it has fixed tests, right?
That's why the attempt one has random tests. To ensure it solved the requirements. The attempt one is not stupid. This kata is not for you if you don't want to solve it in the hard way.
You might wanna do the easier version of this kata instead, in which your algorithm should be able to pass.
Disagree all you want, this doesn't change the fact it's your own fault.
Also, you said you easily solved 2 kyu katas, meanwhile there's not even a single completed 2 kyu kata in your profile.
I guess you just want the question to be able to be solved using simple algorithm. Welp, it is not 2 kyu if it's not hard / challenging, buddy.
What language are you using to solve the kata?
If you're using JS, I just looked at your solution. Your solution is not efficient enough for this kata.
It took around 5 minutes to solve a randomized RGB string with 100k length.
Meanwhile the solution in the test case did it in 13ms.
It is not the kata's fault.
Yeah it doesn't work like that :P
Perhaps your algorithm is not fast enough?