You are viewing a single comment's thread. Return to all comments →
indeed, forgot that end goes through the end of a sequence, so here is my solution
end
function rotLeft(a, d) { const index = d % a.length; return [...a.slice(index), ...a.slice(0, index)]; }
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays: Left Rotation
You are viewing a single comment's thread. Return to all comments →
indeed, forgot that
end
goes through the end of a sequence, so here is my solution