C++ Solution || easy to understand
Code\n\nclass Solution {\npublic:\n    int minimumSum(vector<int>& nums) {\n        int ans=1e9,n=nums.size();\n        for(int i=0;i<n;i++){\n            for(i
# Code\n```\nclass Solution {\npublic:\n    int minimumSum(vector<int>& nums) {\n        int ans=1e9,n=nums.size();\n        for(int i=0;i<n;i++){\n            for(int j=i+1;j<n;j++){\n                for(int k=j+1;k<n;k++){\n                    if(nums[i]<nums[j] && nums[k]<nums[j]){\n                        ans=min(ans,nums[i]+nums[j]+nums[k]);\n                    }\n                }\n            }\n        }\n        return ans==1e9?-1:ans;\n    }\n};\n```
['C++']