Company: DeShaw_30june
Difficulty: medium
Minimum Switches to Zero Problem Description An accounting firm records all the transactions in a linear sequence. Each transaction can have an integer value, and the goal for a clean audit is to adjust all transactions so that every value becomes zero. The firm has a tool that can perform a switch operation and adjust the value of a sequence of transactions. In one switch, it can select a contiguous group of transactions from the start and either add or subtract one unit of value from each transaction in the group. Find the minimum number of switch required to convert every transaction 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> transac