We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce24cd4 commit 1d07bc7Copy full SHA for 1d07bc7
Data-Structures/Array/RotateArray.js
@@ -1,5 +1,6 @@
1
/**
2
* Rotates an array to the right by k positions
3
+ * @see https://en.wikipedia.org/wiki/Circular_shift
4
* @param {number[]} array - The array to rotate
5
* @param {number} k - Number of positions to rotate
6
* @returns {number[]} - New array rotated to the right by k positions
@@ -29,6 +30,7 @@ export function rotateRight(array, k) {
29
30
31
32
* Rotates an array to the left by k positions
33
34
35
36
* @returns {number[]} - New array rotated to the left by k positions
0 commit comments