linux-sysprog · beginner · ~15 min
Compute a balanced work split (ceil division).
Implement int chunks_needed(int items, int workers) returning how many items each worker handles when items are split as evenly as possible (ceiling division). Return 0 if workers <= 0.
int chunks_needed(int items, int workers) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.