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
This comment is hidden because it contains spoiler information about the solution
The right hand side of the
||
is only evaluated if the left hand side is zero (a falsy value). So the sorting prioritizescount
(objects with higher count come first), and when bothcount
s are equal, the next condition is used (alphabetical sorting, bysrc
and then bychar
).The code in the rightmost brackets gets executed first, converting the input string to uppercase.
Then, this value is passed into the leftmost pair of brackets (through the use of an es6 arrow function), and compared against the reversed string.
Please don't spoil solutions.
This comment is hidden because it contains spoiler information about the solution
Your function isn't returning anything, so that's the same as returning
undefined
that is a falsy value, you'll only pass the tests that expectfalse
that way.The tests are fine:
Post your code as instructed here: https://docs.codewars.com/training/troubleshooting/#post-discourse
You must be reading the logs wrong, the first one expects
true
and the otherfalse
.My whole doubt is about how to find n. What kind of formula do I should use?
How are we suppose to know each block takes how many height. The test only give us the so called height, m
"It works" doesn't mean it is correct.
ball_type
is not supposed to be a method, not an issue.Thanks ))