Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions prob-testing.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
// LC 2677 - Chunk Array -- S: O(), T: O()

/*
Nice work so far!
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elliotvhill I've suggested changes to your LC 2677 solution!

I would encouraged you to:

  1. create a new lc-2677 branch on your laptop
  2. make the changes to this file and then git push
  3. create a new pull request add the danielzayas GitHub user as a reviewer
  4. I will comment and suggest changes
  5. After it’s passing all the leetcode tests, we will merge it to the main branch


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
Expand Down