TS Solution
we loop through the array and check if the current number is less than the next number and the next number is less than the next number
if it is, we add the cur
we loop through the array and check if the current number is less than the next number and the next number is less than the next number
    if it is, we add the current number, last number, and the next number to the sum
    we then compare the minimum sum with the current sum and return the minimum sum
    if there are no mountain triplets, we return -1


# Code
```typescript []
function minimumSum(nums: number[]): number {
  let minSum = Infinity
  for (let i = 0; i < nums.length; i++) {
    for (let j = i+1; j < nums.length; j++) {
      for (let k = j+1; k < nums.length; k++) {
        if (nums[i] < nums[j] && nums[k] < nums[j]) {
          const sum = nums[i] + nums[j] + nums[k]
          minSum = Math.min(minSum, sum)
        }
      }
    }
  }
  return minSum == Infinity ? -1 : minSum
};
```
['TypeScript']