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
Although not explicitly stated, the sample tests indicate that the price isn't always an integer, so your calculation might be wrong, and also you type hint the input (see what happened when in not strict mode?).
Closing as this is not an issue with the tests.
That's not the test you're failing. You have a flawed first
if
condition, and return an incorrect value, so you don't even print the array of actual failing test. Try moving yourif
condition afterprint_r
.Make sure to read the last line of description carefully.
null
isn't the same as empty array.The issue is in your code, not the kata itself.