Right smallest + num [i] + Left smallest || Very simple and easy to understand solution
Note: This can be solved with bruteforce approach with checking sum of all three possible with bruteforce as well as the constraint is small. But optimal soluti
Note: This can be solved with bruteforce approach with checking sum of all three possible with bruteforce as well as the constraint is small. But optimal solution is required for similar problem with large input : https://leetcode.com/problems/minimum-sum-of-mountain-triplets-ii/description/\n\n# Approach\n- Find smallest right array \n- Keep finding smallest left and mean while check if the sum of lowest left < current num &&  lowest right < current num. And if satisfy then take the min sum\n\n# Code\n```\nint minimumSum(vector<int>& nums) {\n    vector<int> smallestRight(nums.size(), nums.back());\n    for(int i = nums.size()-2; i >= 0; i--){\n        smallestRight[i] = min(smallestRight[i+1], nums[i]);\n    }\n    int smallestLeft = nums[0], ans = -1;\n    for(int i = 1; i < nums.size(); i++){\n        if(smallestLeft < nums[i] && smallestRight[i] < nums[i]){ \n            if(ans == -1) ans =  nums[i] + smallestRight[i] + smallestLeft;\n            else ans = min(ans, nums[i] + smallestRight[i] + smallestLeft); \n        }\n        smallestLeft = min(smallestLeft, nums[i]);\n    }\n    return ans;\n}\n```\n\n\n---\n\n\n<b>Here is an article of my last interview experience - A Journey to FAANG Company, I recomand you to go through this to know which all resources I have used & how I cracked interview at Amazon:\nhttps://leetcode.com/discuss/interview-experience/3171859/Journey-to-a-FAANG-Company-Amazon-or-SDE2-(L5)-or-Bangalore-or-Oct-2022-Accepted\n\n---
['C++']