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.
Cause it cost a lot of ressources and it's not the best solution. Clever yes, the best no.
Clever but cost lost of compute in case of long strings.
clever!
Even tho you most likely won't see this, but hate to break it to you - not everyone cares about coding principles - if you can do something in one line of code and it is not very unreadable, a lot of people will do just that and most people are fine with that.
In production and development codebases for huge apps - of course its better to keep things simple and readable, but if you can condense two or three loops to just 1-2 lines, but then explain the choice in documentation - thats way better.
This comment is hidden because it contains spoiler information about the solution
I agree, but I also do not know how to overcome that hunger to fit an entire JS library into one line :D
Everyone wants to boil JavaScript down to one-liners but doing that will force you to violate the DRY principle. The conversion to LC in this code should have been stored in a scoped variable so you do not have to repeat yourself and spend the extra cycles converting the string multiple times. Sometimes more is better.
thank you for the explanation this is a very intelligent solution
The best solution. Why it's not first positioned dunno.
This comment is hidden because it contains spoiler information about the solution
Mind blowing, I get very surprised by your solution, is the best over all, I learned a lot, thank you. <3
x + 1 = y + 1 is the same as x = y. It doesn't matter that split returns the number of 'x' plus one, because it does the same for 'o'.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Elegant solution.