File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 6
6
* @returns {number[] } - New array rotated to the right by k positions
7
7
* @throws {TypeError } - If input is not an array
8
8
*/
9
- export function rotateRight ( array , k ) {
9
+ const rotateRight = ( array , k ) => {
10
10
if ( ! Array . isArray ( array ) ) {
11
11
throw new TypeError ( 'Input must be an array' )
12
12
}
@@ -36,7 +36,7 @@ export function rotateRight(array, k) {
36
36
* @returns {number[] } - New array rotated to the left by k positions
37
37
* @throws {TypeError } - If input is not an array
38
38
*/
39
- export function rotateLeft ( array , k ) {
39
+ const rotateLeft = ( array , k ) => {
40
40
if ( ! Array . isArray ( array ) ) {
41
41
throw new TypeError ( 'Input must be an array' )
42
42
}
@@ -57,3 +57,5 @@ export function rotateLeft(array, k) {
57
57
58
58
return rotated
59
59
}
60
+
61
+ export { rotateRight , rotateLeft }
You can’t perform that action at this time.
0 commit comments