AWS provides scalable systems. A set of n servers are used for horizontally scaling an application. The goal is to have the computational power of the servers in non-decreasing order. To do so, you can increase the computational power of each server in any contiguous segment by x. Choose the values of x such that after the computational powers are in non-decreasing order, the sum of the x values is minimum.

Complete the findMinimumSum function.
findMinimumSum has the following parameter(s):
int power[n]: an array of integers representing the initial computational power of the servers.int: the minimum possible sum of integers required to make the array non-decreasing. (Note: The code template expects a long / long_integer return type to prevent overflow).Input:
power = [3, 4, 1, 6, 2]
Output:
7
Explanation: There are n = 5 servers and their computational power = [3, 4, 1, 6, 2].
Input:
3
3
2
1
(power[] size n = 3, power = [3, 2, 1])
Output:
2
Explanation: Add 1 unit to subarray (1, 2) and 1 unit to subarray (2, 2). The final arrangement of servers is [3, 3, 3].
Input:
4
3
5
2
3
(power[] size n = 4, power = [3, 5, 2, 3])
Output:
3
Explanation: Add 3 units to subarray (2, 3). The final arrangement of servers is [3, 5, 5, 6].
Fidelity investment • Pending