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.
Nice one liner using the built in functions! Unfortunately, this still fails when k is higher than n (test case #4).
You seem to be getting around it by overwriting k with:
var k = details[1]%details[0];
I'm curious to see if there are other, more algorithmic solutions to this in Javascript.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Circular Array Rotation
You are viewing a single comment's thread. Return to all comments →
Nice one liner using the built in functions! Unfortunately, this still fails when
k
is higher thann
(test case #4). You seem to be getting around it by overwritingk
with:I'm curious to see if there are other, more algorithmic solutions to this in Javascript.