Simple solution in Java. Beats 100.0 %
Complexity

Time complexity:
O(n^3)


Space complexity:
O(1)

Code
# Complexity
- Time complexity:
O(n^3)

- Space complexity:
O(1)

# Code
```java []
class Solution {
    public int minimumSum(int[] nums) {
        int n = nums.length;
        int minSum = Integer.MAX_VALUE;
        for (int i = 0; i < n - 2; i++) {
            for (int j = i + 1; j < n - 1; j++) {
                for (int k = j + 1; k < n; k++) {
                    if (nums[i] < nums[j] && nums[k] < nums[j]) {
                        int currentSum = nums[i] + nums[j] + nums[k];
                        minSum = Math.min(minSum, currentSum);
                    }
                }
            }
        }
        return minSum == Integer.MAX_VALUE ? -1 : minSum;
    }
}
```
['Array', 'Java']