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.
what is this ...
For what it's worth, from my perspective I thought it was pretty clear. I wonder what you think is poorly explained?
Had to make a web app so that I could visualize & interact with the problem, but after that I was able to find a solution. Very fun kata, not like any I had done before, +1
This comment is hidden because it contains spoiler information about the solution
great concept for a kata and very enjoyable - thank you :)
it's just the enterprise version :)
oh no...
for some reason didn't realize apply() would return the result of calling the constructor. refactored.
This essentially checks all possible sequences, which has a higher complexity than the top solution.
The top solution involves finding the greatest difference between the minimum and maximum points of the running sum. That solution is a lot more beautiful and is also faster.
Not really sure why I didn't write this solution to begin with, because this is what I would do on paper. Fun little problem though
didn't need to check for primes on line 7.
in fact I want to redo this without checking explicitly for primes at all, because it isn't necessary to solve this.