Company: JPMC_20july
Difficulty: medium
Minimum Operations to Balance Consignments Problem Description A shop has n types of items, where the quantity of the i-th item is denoted by quantity[i] . These items are to be shipped in two consignments: The first consignment contains items [1, 2, ..., j] The second consignment contains items [j+1, ..., n] The value of j can be chosen such that 1 (1-based indexing), ensuring both consignments are non-empty and all items of the same type are in the same consignment. The shopkeeper wants to make the total quantities in both consignments equal. To achieve this, they can increase or decrease the quantity of any item type by 1, any number of times. However, the quantity of each item must remain positive. Find the minimum number of operations required to make the quantities of both consignments equal if the items are split optimally. Function Description Complete the function getMinimumOperations in the editor with the following parameters: long getMinimumOperations(vector<int> quan