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.
okay, I'm replying because I spent awhile staring at this and not understanding, trying to figure out how order mattered or somesuch. It appears that the random tests are evaluated after the test runs against your code. So if the original input is modified (via pop, for example), then the rolls passed to the test to validate are incorrect. It (likely) doesn't have anything to do with the result you are calculating.
@amberlovescats14 because the reference solution is called after the user's function, so if you mutate the input, well, the expected value changes. Normally reduce doesn't mutate the array you're working with, but that depends on what you do inside the reduce.
@Chrono79 but why would mutating the array change the output?
I just ran reduce and added a count based on the rules...
Already answered that same question in this same post.
Can someone explain me why this [2, 2, 6, 6, 6] should be 0? We've got three 6's.
Oh... I see... Yes I was. Sorry!
This comment is hidden because it contains spoiler information about the solution
Maybe there is something that I did not understand, but the random cases seem to be wrong in python... The triplets are never scored:
[3, 3, 6, 3, 5] => 350 should equal 50
[2, 2, 6, 6, 6] => 600 should equal 0
[3, 4, 4, 4, 2] => 400 should equal 0
etc.
I pass the tests when there is no triplet though