All questions

Intermediate · JavaScript · Arrays

Rotate an array by k steps

Commonly asked: QA/SDET coding rounds · ~8 min

Write rotate(arr, k) returning a new array rotated right by k (k may be larger than the length).

Checking your membership…