Test1
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
#include <vector>
#include <climits>

using namespace std;

class Solution {
public:
    int minimumSum(vector<int>& nums) {
        int n = nums.size();
        int min_sum = INT_MAX;
        
        for (int j = 1; j < n - 1; ++j) {
            int left_min = INT_MAX;
            for (int i = 0; i < j; ++i) {
                if (nums[i] < nums[j] && nums[i] < left_min) {
                    left_min = nums[i];
                }
            }
            
            int right_min = INT_MAX;
            for (int k = j + 1; k < n; ++k) {
                if (nums[k] < nums[j] && nums[k] < right_min) {
                    right_min = nums[k];
                }
            }
            
            if (left_min != INT_MAX && right_min != INT_MAX) {
                int current_sum = left_min + nums[j] + right_min;
                if (current_sum < min_sum) {
                    min_sum = current_sum;
                }
            }
        }
        
        return (min_sum == INT_MAX) ? -1 : min_sum;
    }
};
```
['C++']