I hope it will help for beginners
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python []\nclass Solution(object):\n    def minimumSum(self, nums):\n        \n        res=[]\n        i=0\n        j=1\n        k=j+1\n        if len(nums) == 3: \n            if nums[0] < nums[1] and nums[2] < nums[1]:\n                 return sum(nums)\n            else:\n                return -1\n        while(i!=len(nums)-2):\n            if(j==len(nums)-1 and i!= len(nums)-2):\n                i+=1\n                j=i+1\n                k=j+1\n            \n            if(k==len(nums)):\n                break\n       \n                \n            if nums[i]<nums[j]:\n                    \n                    if nums[j]>nums[k]:\n                        \n                        res.append(nums[i]+nums[j]+nums[k])\n                        k+=1\n                        if k==len(nums) and j== len(nums)-2 and i == len(nums)-3:\n                            break\n                    else:\n                    \n                        k+=1\n                    if(k==len(nums)):\n                        j+=1\n                        k=j+1\n            else:\n                    \n                    j+=1\n                    k=j+1\n    \n        if(len(res)==0):\n            return -1\n        else:\n             return min(res)      \n\n        \n        \n```
['Python']