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.
one question. I was looking about the join and best practices. But I have not found any info.
Why is not a best practice the use of join? do you have a link or a little explanation about that, pls :)
You might be interested to see a kata I have in beta. Similar to this and time restricted to only allow O(N) solutions.
Check out "Longest non-negative sum sequence."
Well done Nick ! Keep it up !
This comment is hidden because it contains spoiler information about the solution
Not a big fan of Best Practice here as join() is used 3 times...
I think if you are using a smart algorithm, you shouldn't have any risk of timeout. In all of my refactoring, I didn't get a single timeout.
That said, for a 5 kyu kata, you have to think about this pretty hard to find a smart algorithm. This kata is cool, but I think it would be cooler if it were higher-rated and designed to definitely timeout on the naïve O(N²) solution.
True, I was really just trying permutations to see if it effected the time to run the solution. My solution was also O(n), but the timeouts prevented submission...
I would not be surprised if most people cannot complete this kata due to time out issues. Sometimes I can do one or two tests and sometimes none with a time out. Refactored to recursive with no speed improvements. Could not complete this kata (fairly sure it works fine, does locally on number arrays > 1000 items).