3285. Find Indices of Stable Mountains
Read the full problem statement on LeetCode.
Difficulty: easy Acceptance: 86% Topics: Array
View full problem on LeetCode Reading material
Reference solution (spoiler · python)
# Time: O(n)
# Space: O(1)
# array
class Solution(object):
def stableMountains(self, height, threshold):
"""
:type height: List[int]
:type threshold: int
:rtype: List[int]
"""
return [i for i in xrange(1, len(height)) if height[i-1] > threshold]
Solution from kamyu104/LeetCode-Solutions · MIT
Similar questions