Company: Amazon_4th june_on campus _iit guwahti
Difficulty: medium
A set of n parcels needs to be shipped at an Amazon warehouse where the weight of the i th parcel is weights[i] . In a single trip, the truck can carry any one parcel with a weight strictly less than the truck's capacity, max_wt . After each trip, the capacity of the truck max_wt decreases by 1. Given the array weights and an integer max_wt , find the minimum number of parcels that cannot be shipped if the parcels are shipped optimally. Example Assume n = 5 , max_wt = 6 , and weights = [7, 1, 7, 4, 4] . Note that the max_wt capacity of the truck decreases by 1 after every trip. Neither of the remaining parcels weighs less than the current max_wt , 3. The minimum number of parcels that cannot be shipped is 2 . Function Description Complete the function getMinUnshippedParcels in the editor below. getMinUnshippedParcels has the following parameters: int weights[n] : the weights of the parcels int max_wt : the maximum weight the truck can carry initially Returns int : the minimum number of