Company: Amazon_24oct
Difficulty: medium
Minimum Shipments Problem Description A logistics coordinator at a regional fulfillment center must dispatch n items pulled from various warehouses, where the warehouse holding the i th item is given by the array warehouses[i]. The coordinator can perform one operation at a time, chosen from the following: If the inventory holds two or more items, pick two items x and y stored in different warehouses (i.e. warehouses[x] != warehouses[y]) and dispatch both together. If the inventory holds one or more items, pick a single item x and dispatch it on its own. Note: Once an item is dispatched it leaves the inventory, and the remaining undispatched items close ranks, preserving their original relative order. Given n items and the array warehouses, find the fewest operations the coordinator needs in order to dispatch every item. Function Description Complete the function `calculateMinShipments` in the editor below. `calculateMinShipments` has the following parameter(s): `int warehouses[n]:` th