Array Chunk Problem
Array Chunk Problem — ExecCode School DSA Practice
Solve the Array Chunk problem on ExecCode. Free online school DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.
Problem description
You are given a list of whole numbers and a chunk size. Your task is to solve Array Chunk. Split the list into smaller groups of that size and print the groups as shown in the examples.
Examples
Input 5 2 1 2 3 4 5; Output 1 2 3 4 Input 4 3 1 2 3 4; Output 1 2 3 4
Constraints
1<=K<=N<=10^4
Practice Array Chunk free on ExecCode. Browse DSA problems, topic map, and placement guides.