diff --git a/prob-testing.js b/prob-testing.js index 61ff3b4..8f22285 100644 --- a/prob-testing.js +++ b/prob-testing.js @@ -1,5 +1,25 @@ // LC 2677 - Chunk Array -- S: O(), T: O() +/* +Nice work so far! + +I would think about this problem in two parts: + +(1) How do I create one of the chunks? +const createOneChunk = function (arr, size, startIndex) {} +// If start_index is out of bounds, return an empty array +// Otherwise return a new non-empty array of the chuck of elements starting at startIndex +// Note that the new array may have a length less than `size` + +(2) How do I use (1) to create the final chunked array output? +const chunk = function (arr, size) {} +// initialize a startIndex at 0 and an outputArray +// while I still have more chucks to add to the outputArray +// create a chunk (use createOneChunk), +// add it to outputArray, +// and update startIndex +*/ + /** * @param {Array} arr * @param {number} size