Back to problems

Split Data into Minimum Chunks with Max Chunk Size

Algorithm · Google · Medium

You must send data bytes after breaking them into separate chunks. Requirements: The size of every chunk must be a positive integer. No chunk may exceed maxChunkSize. Produce as few chunks as possible. When more than one minimum-count division is possible, any of them is acceptable; a nearly even division, with chunk sizes differing by no more than 1, is preferred. Return an array named chunks containing the chunk sizes. Example: data=1450, maxChunkSize=600 => [484,483,483].…

Checking your access…