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.
Thanks for drawing attention to this corner case!
Right, so it counts as the full '2' (as opposed to being only 'worth' 1.
This comment is hidden because it contains spoiler information about the solution
My code
Javathrows a divide-by-zero exception in the main test suite for the random big numbers. Careful with the overflow :)787 is both palindrome and two before 789...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm sorry, but I can't comprehend the phrase "at least as long as when evenly divided".
The answer obtained by googling your suggested phrase goes to a stackoverflow question about doing this in python. The two most common approaches there split a list either as
which is simply the result of partition a 75-long list into chunks of 10 plus the leftover and has nothing to do with equal splitting,
or as
It's easy to see, that any list can be split into any amount of chunks which differ in length by no more than 1. Here's an example:
Is it a requirement that the first two chunks be equal in length? What about
1 -> 1 0 0 ...
?Because, honestly, I do not see how
6 -> 2 2 1 1 0
is more desirable. It seems to break the pattern, though it is much more like11 -> 3 3 3 2 0
(but why not3 3 2 2 1
?).