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.
This comment is hidden because it contains spoiler information about the solution
Why is there a whitespace after a '\w' and before ']'?
This explanation from njxue should be added to the description of the kata - the actual description of the Kata is confusing. Thanks nxjue!
Its accident
I have the same problem.
We are mutating (reducing) the items arrays' length every time we execute splice method.
Modulo is used to check if our index value is bigger than an arrays' length.
If it is we just use the remainder as an index, because it goes at the begining of an array again.
Think of it like a circle, it will go back to where it began.
Why are we writing '% 256' in these two lines:
And why did he make an 'l' variable inside of for loop? I don't think it's necessary?
Thank You Guys so much, I finally get it!
Please use spoiler flag next time.
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
if list_squared(m, n), find all the numbers, x, between m and n (both inclusive) such that the sum of x's factors is a perfect square.
Return [[x1, perfect-square1], [x2, perfect-square2]]
eg list_squared(1, 250) ==> [[1, 1], [42, 2500], [246, 84100]] becuase 1 has factors [1] and 1^2 == 1 (perfect square)
42 has factors [1,2,3,6,7,14,21,42] and the sum of the sqaured factors is 1^2 + 2^2 + 3^2 + 6^2 + 7^2 + 14^2 + 21^2 + 42^2 == 2500 (perfect square)
Can someone please explain this kata to me?
I have spent 30 minutes reading the description and just can't figure out what I need to do!
Basically you are asigning value to your key inside object count.
(count[s] || 0) + 1 means that if there is no value(count) of that specific letter, value 0 is being assigned to it and then it is increased by 1.
If we encounter a letter which count is bigger than 1 (not 0 or undefined) than we reach that value and add 1 to it.
Loading more items...