can you explain all of it please
Nice! Learned a new neat trick.
This comment is hidden because it contains spoiler information about the solution
Wouldn't this be O(nlogn) since every is only iterating over the elements to the right of e?
Ha, I did the same, except I had i === 0 at first, but it's not necessary due to (i + 1) % 5.
i === 0
(i + 1) % 5
How do you find the Time complexity of functions like filter and slice. is there a website for this?
In the reduce function, what is the purpose of 0? having a lil trouble getting reduce functions..
sende amk ne mal insansınız siz
I'm sort of a js noob, how did you compare the execution times and with what inputs? I tried using something called perflink and somehow got the exact opposite result?
A lot of people are really up their own behinds about this not being the best practice, thinking that it's because coders don't know basic math instead of the fact that the computation time on this O(n) is over twice as long as a while loop. Elitists are often not elite, and the comments on this solution are the proof.