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.
This comment is hidden because it contains spoiler information about the solution
Very nice solution and good for learning!
This comment is hidden because it contains spoiler information about the solution
It seems the tests do not test all requirements.
For example:
apples: 9 capacity: 20 max_left: 2
Should yield 7 (according to tests)
e.g.
buckets: 1 apples per bucket: 9 rest: 0
buckets: 2 apples per bucket: 4 rest: 1
buckets: 3 apples per bucket: 3 rest: 0
buckets: 4 apples per bucket: 2 rest: 1
buckets: 7 apples per bucket: 1 rest: 2
buckets: 8 apples per bucket: 1 rest: 1
buckets: 9 apples per bucket: 1 rest: 0
However this fails the criteria:
"if each box contains x apples, the number of left out apples should be less than x."
for:
buckets: 7 apples per bucket: 1 rest: 2 ( 2 > 1 )
oprypin inspired, that solution voted for Best Practises +1
Only needs to left strip a leading '-' since we won't have a trailing '-'