I have been trying to solve a problem where i needed to find the sum of the minimum of all the subarrays of an array. If someone know of an O(N) algorithm to such problem. Thanks.
Sum of the minimum of all subarrays
I have been trying to solve a problem where i needed to find the sum of the minimum of all the subarrays of an array. If someone know of an O(N) algorithm to such problem. Thanks.