Tap here to switch tabs
Problem
Submissions

Problem: Find Indices of Stable Mountains

med
30 min
Try to solve the Find Indices of Stable Mountains problem.

Statement

You are given an integer array height representing the heights of nn mountains, and an integer threshold.

A mountain at index i (where 1≤i<n1 \leq i < n) is considered stable if the mountain immediately before it has a height strictly greater than threshold, which means height[i - 1] > threshold. Mountain 00 is not stable.

Return an array containing the indices of all stable mountains in any order.

Constraints:

  • 2≤n==2 \leq n == height.length ≤100\leq 100

  • 1≤1 \leq height[i] ≤100\leq 100

  • 1≤1 \leq threshold ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find Indices of Stable Mountains

med
30 min
Try to solve the Find Indices of Stable Mountains problem.

Statement

You are given an integer array height representing the heights of nn mountains, and an integer threshold.

A mountain at index i (where 1≤i<n1 \leq i < n) is considered stable if the mountain immediately before it has a height strictly greater than threshold, which means height[i - 1] > threshold. Mountain 00 is not stable.

Return an array containing the indices of all stable mountains in any order.

Constraints:

  • 2≤n==2 \leq n == height.length ≤100\leq 100

  • 1≤1 \leq height[i] ≤100\leq 100

  • 1≤1 \leq threshold ≤100\leq 100