Practice Find Indices of Stable Mountains
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
There are n mountains in a row, and each mountain has a height. You are given an integer array height where height[i] represents the height of mountain i, and an integer threshold. A mountain is called stable if the mountain just before it (if it exists) has a height strictly greater than threshold. Note that mountain 0 is not stable. Return an array containing the indices of all stable mountains in any order.
Source: Find Indices of Stable Mountains on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
height = [1,2,3,4,5], threshold = 2
[3,4]
# Example 2
height = [10,1,10,1,10], threshold = 3
[1,3]
# Example 3
height = [10,1,10,1,10], threshold = 10
[]
Constraints
Related LeetCode Problems
Practice more problems similar to Find Indices of Stable Mountains.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.