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 66 * @returns {number[] } - New array rotated to the right by k positions
77 * @throws {TypeError } - If input is not an array
88 */
9- export function rotateRight ( array , k ) {
9+ const rotateRight = ( array , k ) => {
1010 if ( ! Array . isArray ( array ) ) {
1111 throw new TypeError ( 'Input must be an array' )
1212 }
@@ -36,7 +36,7 @@ export function rotateRight(array, k) {
3636 * @returns {number[] } - New array rotated to the left by k positions
3737 * @throws {TypeError } - If input is not an array
3838 */
39- export function rotateLeft ( array , k ) {
39+ const rotateLeft = ( array , k ) => {
4040 if ( ! Array . isArray ( array ) ) {
4141 throw new TypeError ( 'Input must be an array' )
4242 }
@@ -57,3 +57,5 @@ export function rotateLeft(array, k) {
5757
5858 return rotated
5959}
60+
61+ export { rotateRight , rotateLeft }
You can’t perform that action at this time.
0 commit comments