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.
Great!
Have a good time on codewars!
I stand corrected. I missed that detail. Thanks; very simple fix
Hi steffen,
thank you for the answer. I think you're right but my suggestion is only to modify the description or the example tests to clarify more.
The tests are right. Your code is wrong!
From the description: "When an array in the array is null or empty, the method should return 0 too!"
As you see in this random test, the first array is empty! So the correct answer would be: 0 and not 6
The basic and random tests in the full suite for PHP might have an issue. The result's always something similar to this:
testBasicTests
✘ Failed asserting that 0 is identical to 1.
Completed in 0.23ms
testRandoms
✘ Wrong for [[],[39],[37,50,15],[49,36,16,17,14],[16,46,12,22,42,16,28,18],[44,18,15,13],[3,31,19,22,41,39,0],[28,37]]
Failed asserting that 0 is identical to 6.
Running the code separately actually returns the correct value - 6 for the random case (and whatever other random value the assertion returns). There must be an issue with how the execution's being done