Tap here to switch tabs
Problem
Submissions

Problem: Minimum Sum of Mountain Triplets II

Try to solve the Minimum Sum of Mountain Triplets II problem.

Statement

You are given a 00 indexed integer array nums.

A triplet of indices (i, j, k) is called a mountain triplet if:

  • i << j << k

  • nums[i] << nums[j] and nums[k] << nums[j]

Return the minimum possible sum of a mountain triplet in nums. If no mountain triplet exists, return −1-1.

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤108\leq 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Sum of Mountain Triplets II

Try to solve the Minimum Sum of Mountain Triplets II problem.

Statement

You are given a 00 indexed integer array nums.

A triplet of indices (i, j, k) is called a mountain triplet if:

  • i << j << k

  • nums[i] << nums[j] and nums[k] << nums[j]

Return the minimum possible sum of a mountain triplet in nums. If no mountain triplet exists, return −1-1.

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤108\leq 10^8