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.
Great that you spotted that!
Don't return null man))
Lol, funny...
Wow, it's really interesting solution through ternary operator
At first I was like "Hahahaahaa", then after around 3 seconds I had a sweat in my forehead (for validations).
wtf
Validations are important. Had no idea this simple problem could lead me to this piece of elegance ;w;
Simple.
love the null check
i don't think it's a best practice.if the paramter is null,maybe it's better to fail fast,forward null is not good
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Because it equals 2 * 2.
I love it - always check your input. This is something that codewars' katas lack - they just don't have corner cases with invalid input.
The issue is that you replied to my comment as if the test cases were implemented when I made the comment. I then went through the test cases thinking that my code had passed them.
It turns out that these test cases were added after my comment, as is evident by your answer to the comment by chuckwondo where both comments have been made after mine.
Loading more items...