Search
⌘K

Leetcode 2908. Minimum Sum of Mountain Triplets I

Find indices i < j < k with nums[i] < nums[j] and nums[k] < nums[j] (so nums[j] is a "peak") and return the minimum possible sum nums[i]+nums[j]+nums[k], or -1 if none exists. Equivalent view: for each candidate peak j, pick the smallest qualifying left and right elements less than nums[j] to minimize the total.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.