Got it, thanks a lot! And this is why the problem were starting for the random items: before that, you were checking my solution against a pre-defined solution. When the items are random, you do need to check my solution against a solution generated by your script, which is why it failed.
In that case, I should have created a deep copy of the list, and ran my code on this particular list. I do agree that tuples are a better option, as they are immutables. In that case, the Test cases should be changed to reflect this :).
Very good kata otherwise, and thanks a lot for your reactivity!
There seems to be an issue with the validation of the first random passes (copying the exact same configuration of items in a Test case returns a Pass for my code, so I definitely think the validation is to blame here). Furthermore, the suggestion for the validation is an empty list (e.g. "[0, 8, 0, 0, 0, 0, 0] should equal []"), which further hints at an error.
Last item does not pass in Python either, probably due to rounding error.
Got it, thanks a lot! And this is why the problem were starting for the random items: before that, you were checking my solution against a pre-defined solution. When the items are random, you do need to check my solution against a solution generated by your script, which is why it failed.
In that case, I should have created a deep copy of the list, and ran my code on this particular list. I do agree that tuples are a better option, as they are immutables. In that case, the Test cases should be changed to reflect this :).
Very good kata otherwise, and thanks a lot for your reactivity!
This comment is hidden because it contains spoiler information about the solution
There seems to be an issue with the validation of the first random passes (copying the exact same configuration of items in a Test case returns a Pass for my code, so I definitely think the validation is to blame here). Furthermore, the suggestion for the validation is an empty list (e.g. "[0, 8, 0, 0, 0, 0, 0] should equal []"), which further hints at an error.