Company: DeShaw_30june
Difficulty: medium
Minimum Switches to Zero Problem Description A logistics team keeps a running ledger of adjustments for a line of storage bins, each holding an integer value. To close the ledger cleanly, every bin's value must be brought down to zero. The team's tool performs a switch operation: in one switch, you pick a prefix of the bins - a contiguous run starting from the very first bin - and either add 1 to every bin in it or subtract 1 from every bin in it. Find the minimum number of switches needed to bring every bin down to 0. Note: It is guaranteed that it is always possible to convert every element of the array to 0. Complete the function getMinimumSwitches in the editor below: The function getMinimumSwitches has the following parameter: transactions[n] : an array of integers Returns: long : denoting the minimum number of switches required to convert every element to 0 long getMinimumSwitches(vector<int> transactions) { int n = transactions.size(); for (int i = 0; i < n; i++) { // F