← All problemsSign in

2908. Minimum Sum of Mountain Triplets I

LeetCodeArrayOpen on judge ↗

You are given a 0-indexed array nums of integers. A triplet of indices (i, j, k) is a mountain if: - i < j < k - nums[i] < nums[j] and nums[k] < nums[j] Return the minimum possible sum of a mountain triplet of nums. If no such triplet exists, return -1. Example 1: Input: nums = [8,6,1,5,3] Output: 9 Explanation: Triplet (2, 3, 4) is a mountain triplet of sum 9 since: - 2 < 3 < 4 - nums[2]

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start