Given an array of integers representing traffic volumes of different lanes, find the optimal allocation to minimize congestion by rearranging the traffic volumes. The congestion is calculated as the maximum traffic volume in any lane.
Explanation: The optimal allocation is achieved by sorting the traffic volumes, resulting in [1, 2, 4, 7] and a minimum congestion of 4
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak