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.
From 206 tests 1 is failed, "0 should equal 14", can anyone tell me why?
1
This comment is hidden because it contains spoiler information about the solution
From the description:
If a list is empty return an empty list. If one of the elements is an empty string, that is invalid and should be handled.
I have problems with empty string. What can I do in this case?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Print the input, reread the description, check the posts below.
I have one failed test: "3 should equal 4" and I don't understand why.
I'm not familiar with PHP, but I looked at the docs and the problem you seem to be having is that PHP
sort()
directly changes the array you're trying to sort, instead of returning it. It returnstrue
when the array has been sorted successfully andfalse
when the function has run into a problem and thus was not able to sort the array. Hope this helps. Reminder -- you can always google problems you have, and docs for specific languages are available online, too.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
input
does not work because input in Codewars is not entered through the console. It's entered as parameters to a function. So, you can't useinput
because there's nothing to input. Use the information entered to you through the function instead. This applies to almost every kata in Codewars. Hope this helps, happy coding!I did it, but I am interesting in why I can't passed this test with "input" function? At firs I was writing this kata with "input" but it wasn't true.