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.
crazy clever!
there is no need for a ternary operator since return already returns a boolean value (true or false)
I do not agree with you. In english, space char is the word's separator. An anagram is a WORD that can be mixed to create another. So, in 'E h llo' there are 3 differents words.
If you consider 'E h llo' as string, and not as a word, spaces are part of this string.
To me, if this issue is not specified in the instructions, your exemple should return false by default.
Just an opinion
my solution is one line.
DRY
no need of ternary operator, just compare t&o it'll return a Boolean
True, they are useless here. Just return the result of the comparison.
But you defined new variables yourself
Oh my lord, I feel silly for counting the letters in both strings now.
This idea is similar to what I did, but you do not need the ternary operator for the return. If the strings are equal, then it will automatically return true, false otherwise.
Also, defining new variables is unecessary. Just return the comparison.
Mind elaborate?
I agree, but I also believe that a solution should only be optimised if it times out.
I added in my solution checking the length equality of the words to save time if we have "cat" and "hipopotam".
Bad solution
Funny how this gets best practice upvotes, ugly runtime...
Loading more items...