Brute Force | Beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n- Constraints are very small\n- So, BRUTE FORCE.\n# Complexity\n- Time complexity:O(N*3
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n- Constraints are very small\n- So, BRUTE FORCE.\n# Complexity\n- Time complexity:O(N*3)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int minimumSum(int[] nums) {\n        int n=nums.length;\n        int min=500;\n        for(int i=0;i<n-2;i++){\n            for(int j=i+1;j<n-1;j++){\n                for(int k=j+1;k<n;k++){\n                    if(nums[i]<nums[j] && nums[k]<nums[j]){\n                        int sum=nums[i]+nums[j]+nums[k];\n                        min=Math.min(min,sum);\n                    }\n                }\n            }\n        }\n        return min==500?-1:min;\n    }\n}\n```
['Array', 'Java']