Simple Solution 
Code


# Code
```javascript []
/**
 * @param {number[]} nums
 * @return {number}
 */
var minimumSum = function (nums) {
    let n = nums.length;
    let minSum = Infinity;

    for (let j = 1; j < n - 1; j++) {
        let leftMin = Infinity;
        let rightMin = Infinity;

        for (let i = 0; i < j; i++) {
            if (nums[i] < nums[j]) {
                leftMin = Math.min(leftMin, nums[i]);
            }
        }

        for (let k = j + 1; k < n; k++) {
            if (nums[k] < nums[j]) {
                rightMin = Math.min(rightMin, nums[k]);
            }
        }

        if (leftMin !== Infinity && rightMin !== Infinity) {
            minSum = Math.min(minSum, leftMin + nums[j] + rightMin);
        }
    }

    return minSum === Infinity ? -1 : minSum;
};

```
['JavaScript']