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.
perhaps the description is a bit ambiguous indeed,
something like:
"The priority is that the space to insert the new barrels to be as small as possible."
maybe it will get better
because the priority is to find the smallest space, if there is a space that fits but it is larger, the choice will be the smallest space
in this case
['', '', '', '0', '', '']
, the smallest space that fits is in indexes 4-5, the space in indexes 0-2 is bigger so they should not be put therein the case of the warehouse like this:
warehouse = ['', '', '0', '0', '', ''], barrels = ['0', '0']
, then the barrels must be inserted in position 0-1, because it is leftmostThe tests are inconsistent with the requirements and among themselves:
implies that array should be filled frol left to right or from index 0 to index -1(in python)
Some tests follow through with it but some tests don't:
testing for: warehouse = ['', '', '', '0', '', ''], barrels = ['0', '0']
['0', '0', '', '0', '', ''] should equal ['', '', '', '0', '0', '0']
testing for: warehouse = ['', '', '0', '', '', '0', '0', '', '', '', '0', '', '', '', ''], barrels = ['0', '0', '0']
Test Passed
in the first test the issue is that warehouse is expected to be filled frol right to left or from index -1 to 0.
The issue of the other test is that it is complitely fine if array is filled from left to right or from 0 to -1.
Otherwise it's a nice task I had fun solving. Thank you for that.