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.
Yes.
Finding the LCA is a well known problem. This probably made most early-solvers vote kyu 6. If you want even more of a challenge, there's this kata waiting for you :)
We cannot help since you provide no information.
The point is this:
Because you try to apply
map
to something that isnull
, and this is incorrect in (I guess) JavaScript.Thanks! I wouldn't be able to solve if I hadn't read your comment.
All of the categories have to either be unique within their set or the same.
In JS, like in most languages (Python is an exception), concatenating comparisons does not work.
Well, it works (in JS at least, in Rust for example you would get an error from the compiler) but does not do what you expect: the expression is evaluated from left to right this way:
Mmmmmmm, yes...?
this is the test:
So, you probably saw the result from a different test. (The log appearts above the test result)
Also, when you post code, use proper code markdown and click the spoiler tag. (I had to add that to hide your code)
Take for example, the key with
5jkl
on it: it has 4 things you might want to use, but you can't just type the same thing to get each of them. So you just press once for5
, but you have to press twice to get aj
, if you wantk
you press three times, and you need to press four times for that same key to produce the letterl
.Yes, you only have to apply string manipulation and if statements.
console.log
works (make sure it's the first line in your code), and what you should return is stated in the kata description, that array without the last element.There is code written for you that doesn't work as one can think it should, your work is figuring out why.