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.
Beside copying from w3fools, this "solution" is neither clever nor best practice - it is inherently wrong.
Bitshifting by zero will have a sideeffect on large numbers, especially negative ones.
The output will be a positive number that is way too small and not the result of the calculation anymore. Bitshifting using
>>>
will replace the first bit with a zero, converting negative numbers into positive ones.Anyone else is wondering why some "clever" solutions in javascript clutter memory by using the map function to slice k array items at the given index? What a waste of RAM! Not very clever imho...
I love this solution very much, it is very neat, clean and effective!
a
is the accumulator and[_,d]
is the inner array of lst, spread to the variables_
andd
. Why_
as var-name? Just because its unused.the
1
is the initial value of the accumulator.the performance of this recursion is very bad, for example
a = 10000
andb = 1
This comment is hidden because it contains spoiler information about the solution
like this approach, as the directory can be passed as argument :) neat solution, also the regex
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You replace it with char
\0
(Null-character) instad of an empty string.This website is for losers LOL!
results inTh\0s w\0bs\0t\0 \0s f\0r l\0s\0rs L\0L!
.