Brute Force | | C++ 🎊🎉
Complexity

Time complexity:
O(n3)


Space complexity:
O(1)

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

- Space complexity:
$$O(1)$$

# Code
```cpp []
class Solution {
public:
    int minimumSum(vector<int>& nums) {
        int min = INT_MAX;
        bool flag = false;
        for (int i = 0; i < nums.size(); i++) {
            for (int j = i + 1; j < nums.size(); j++) {
                for (int k = j + 1; k < nums.size(); k++) {
                    if ((nums[i] < nums[j]) && (nums[k] < nums[j])) {
                        flag = true;
                        if (min > nums[i] + nums[j] + nums[k]) {
                            min = nums[i] + nums[j] + nums[k];
                        }
                    }
                }
            }
        }
        if (flag) {
            return min;
        } else {
            return -1;
        }
    }
};
```
['Array', 'C++']