Company: Amazon_4sep
Difficulty: medium
Optimize Inventory Shipments Problem Description An Amazon warehouse processes n shipments, where each shipment affects the inventory levels. These effects are provided in the inventoryAdjustments array, with positive values representing restocks and negative values indicating items taken out for orders. Starting with zero inventory level, the goal is to process shipments in an optimal order to maximize the number of shipments completed while maintaining a strictly positive inventory level. If the inventory reaches zero or goes negative, operations halt, and no further shipments can be processed. Given an integer array inventoryAdjustments of length n . Find the maximum number of shipments that can be processed without depleting the inventory. Note: Each shipment can be processed only once, with the initial inventory set to zero. Complete the function optimizeInventory in the editor. optimizeInventory has the following parameter(s): int inventoryAdjustments[n] : an array of integers re