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.
I like it Phil! Certainly better than mine. :)
Thanks for the tip and the interesting kata! I've worked on this off and on for the last few weeks and it feels good to finally solve it :)
You need a solution faster than O(n).
Edit: Wait, if you can pass the 7th test (the test with very big numbers) it should already be faster than O(n). In that case I guess it's due to some edge cases triggering infinite loop?
Thanks for taking a look. It passes the sample tests in 0.026472ms but now I get the 12 second duration error message. Is my algorithm still too slow?
Okay, now I see what's the problem. Fixed.
This comment is hidden because it contains spoiler information about the solution
It might have to do with how you dealt with the
Debug
switch.Can you post your code in the reply (with spoilers)?
I'm using C# and I have a solution that passes the example tests. However when I attempt the kata it says there were three compilation warnings like:
/home/codewarrior/fixture.cs(48,6): warning CS0162: Unreachable code detected
Any idea what would cause this? I am using a second function and I have included a second "using" at the top. All of the code is reachable (as I said it passes the example tests just fine) but I don't know exactly how it is run on the server. Is there something I need to watch out for when working with C# on codewars.com?