Distribute Packages

Problem Overview

  • Allocate to_distribute packages across trucks to minimize the maximum total load per truck.
  • Input: int[] trucks (current loads) and int to_distribute; Output: int[] packages allocated per truck.
  • Real-world domain: logistics load balancing for delivery trucks.
  • From Amazon interviews; a common coding interview problem and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: