Company: Amazon_24oct
Difficulty: medium
Minimum Shipments Problem Description The logistics coordinator at an Amazon fulfillment center needs to dispatch n items from different warehouses, the warehouse of the i th item is represented by an array warehouses[i]. The coordinator is allowed to perform one operation at a time. Each operation is described below: If the inventory has two or more items, the coordinator can select two items x and y from the inventory if they are stored in different warehouses. i.e. warehouses[x] != warehouses[y] and dispatch both of them. If the inventory has one or more items, the coordinator can select one item x from the inventory and dispatch it. Note: After dispatching an item it gets removed from the inventory, and the rest of the items which are currently not dispatched come together keeping the order the same as before. Given n items and an array warehouses, find the minimum number of operations that the coordinator has to perform to dispatch all of the items. Function Description Complete t