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.
Definitely looks more "code-y" but uses extra memory for variables and unnecessary loops.
while
numbers.reduce
would allow for scores of any length, that is not necessary for the prompt requirements and is actually overengineered for this task.Nice. I try to make something similar with Object's iterations and avoid using a 'typical' if-else construction.
Thanks for showing .hasOwnProperty property for 'for-in' implementation
This comment is hidden because it contains spoiler information about the solution
but
why
Good solution, this one would be O(n) compared to the O(n^2) that are more popular right?
ty
memo[char]?memo[char]+1:1
is not actuallying assigning anything to thememo
object (which is used as a table for holding character counts)This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
No?
It's interesting. The solution is based on NaN != NaN, isn't it?
I imagine getting a new job and my first task is tweak this code. I think I would resign right there. Nicely done though 👀
Excellent!
Loading more items...