-
Notifications
You must be signed in to change notification settings - Fork 927
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f99c56
commit bcaf819
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Rotate an array left by k number of times. | ||
* | ||
* @example | ||
* rotateLeft([1,2,3], 1); // [2,3,1] | ||
* rotateLeft([1,2,3,4,5], 4); // [5,1,2,3,4] | ||
* | ||
* rotateLeft(Array(1e6).fill(1), 1e4); // <scale testing> | ||
* | ||
* @param a - The array | ||
* @param k - The number of times the array is rotated | ||
*/ | ||
function rotateLeft(a, k) { | ||
// write you code and test with examples | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Return the sum of two arrays as a new array. | ||
* | ||
* @example | ||
* sum([1,2,3], [1,1,1]); // [2,3,4] | ||
* sum([1], [9,9,9]); // [1,0,0,0] | ||
* | ||
* @param {number[]} a - Array of numbers. | ||
* @param {number[]} b - Array of numbers. | ||
* @returns {number[]} the sum array. | ||
*/ | ||
function sum(a, b) { | ||
} |