Python 3 || 3 lines,  prefix, suffix   ||   xx
Here\'s the plan:\n1. We constructprefandsuffof minimum values innums.\n\n1. For eachninnums, we useprefandsuffto identify pands,the least elements to the left 
Here\'s the plan:\n1. We construct`pref`and`suff`of minimum values in`nums`.\n\n1. For each`n`in`nums`, we use`pref`and`suff`to identify `p`and`s`,the least elements to the left and right of `n`respectively. If `p < n` and `n > s`, then `p,n,s` is the minimum *mountain triplet* centered at `n`.\n1. We return the minimum mountain triplet over all `n` in `nums`. \n```\nclass Solution:\n  def minimumSum(self, nums: List[int]) -> int:\n\n    pref = list(accumulate(nums, func = min))\n    suff = list(accumulate(nums[::-1], func = min))[-3::-1]\n\n    return min((p + n + s for p, n, s in zip(pref, nums[1:-1], suff)\n                                 if (p < n and n > s)), default= -1)\n```\n[https://leetcode.com/problems/minimum-sum-of-mountain-triplets-i/submissions/1081490304/](http://)\n\n\nI could be wrong, but I think that time complexity is *O*(*N*) and space complexity is *O*(*N*), in which *N* ~ `len(nums)`.
['Python3']