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.
$ sign wasn't even necessary.
I used a solution similar to this one at first and passed but when I came back and tried an optimized version the optimized code does pass but this old version won't anymore. I think sometimes you can get lucky with this approach if the randomized tests are smaller numbers, but in general they expect the solution to be more optimized. This should probably be higher than kyu 6 imo because 7's generally don't care so much about optimization and this unoptomized approach is the more obvious answer.
This comment is hidden because it contains spoiler information about the solution
Same here, I couldn't figure out how to implement regex like this one then I gave up xD.
This comment is hidden because it contains spoiler information about the solution
You're misreading the logs, your code fails the 4th test, not the 1st.
And that's exactly what is happening. Just like the message indicates, your code incorrectly returns
true
when it should returnfalse
.The name of the function should be
count
, notcount_occur
. You can confirm this by checking how your function is being called in the sample tests:The solution setup (the code you see when you enter the trainer for the first time) also includes a function named
count
.Finally, please use appropriate formatting (code blocks) when posting code.