SalesForce Hackerrank
You are given a list of maximum heights for N towers.
[1, i, ... n]
Your goal is to return the maximum possible sum of the N towers' height.
The constraints are:
for a tower i where there is [1...j,i,k...n] it should not be the case where height[j] > height[i] and height[i] < height[k] (AKA no valleys in terms of height) where 0<= j < i < k < n
e.g.
[5,10,5,10,5] => [5,10,5,5,5] is a possible solution so the answer would be 30
[10,9,6,7,80] => [6,6,6,7,80] is the solution so the answer would be 105