Company: Amazon_24sep
Difficulty: medium
Maximum Storage Efficiency Problem Description You're managing Amazon's cloud storage system. There are n tasks that need to be processed, and the i th task is broken into num_segments[i] segments. The cloud storage is divided into m storage units. The segments are allocated to these units with the following rules: Each segment is stored in exactly one storage unit. Each storage unit must hold at least one segment. A storage unit cannot contain segments from more than one task. The storage efficiency is measured by the minimum number of segments that any storage unit contains. Your task is to organize the segments in such a way that this storage efficiency is maximized. Illustrative Example: Consider the following inputs: n = 3 num_segments = [7, 10, 5] m = 4 There are 3 tasks that need to be processed. Task 1 has 7 segments, Task 2 has 10 segments, and Task 3 has 5 segments. One of the optimal ways to allocate is: Storage unit 1: all 7 segments from task 1 Storage unit 2: 5 segments f