We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Perhaps competency is using certain language features?
Not trying to be a troll but one could say that syntax like:
let[hi,lo]=[scores[0],scores[0]];
is as much built-in as Math.max() or Array.reduce() which access javascript type-primitive methods.
The loop method is much more efficient, however, since it maintains the min & max rather than recalculating it every time w the reduce(). I think I managed to create a very nice example of Schlemiel the painter's algorithm
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Breaking the Records
You are viewing a single comment's thread. Return to all comments →
Perhaps competency is using certain language features? Not trying to be a troll but one could say that syntax like:
is as much built-in as
Math.max()
orArray.reduce()
which access javascript type-primitive methods.The loop method is much more efficient, however, since it maintains the min & max rather than recalculating it every time w the
reduce()
. I think I managed to create a very nice example of Schlemiel the painter's algorithm