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
Cannot pass it on PHP.
Strangely, random test passes OK, but testBasic fails.
Moreover, in testBasic code I see only two tests, but when running there are three. I dumped arrays and cannot find the issue.
Time: 405ms Passed: 1 Failed: 1
Test Results:
AreTheyTheSameTestCases
testBasics
Log
Array
(
[0] => 121
[1] => 361
[2] => 361
[3] => 361
[4] => 14641
[5] => 20736
[6] => 20736
[7] => 25921
)
Array
(
[0] => 121
[1] => 361
[2] => 361
[3] => 361
[4] => 14641
[5] => 20736
[6] => 20736
[7] => 25921
)
1Array
(
[0] => 121
[1] => 361
[2] => 361
[3] => 361
[4] => 14641
[5] => 20736
[6] => 20736
[7] => 25921
)
Array
(
[0] => 231
[1] => 361
[2] => 361
[3] => 361
[4] => 14641
[5] => 20736
[6] => 20736
[7] => 25921
)
Array
(
[0] => 121
[1] => 361
[2] => 361
[3] => 361
[4] => 14641
[5] => 20736
[6] => 20736
[7] => 25921
)
Array
(
[0] => 121
[1] => 361
[2] => 361
[3] => 14641
[4] => 20736
[5] => 20736
[6] => 25921
[7] => 36100
)
✘ Failed asserting that false matches expected true.
Completed in 0.29ms
testRandom (1 Passed, 0 Failed)
Bad solution, but looks elegant. Good solution requires two array iterations.