2025-08-24 09:47:23 +0000 UTC

Find Indices of Stable Mountains

Code

class Solution:
    def stableMountains(self, height: List[int], threshold: int) -> List[int]:
        res, n = [], len(height)
        for i in range(1, n):
            cur, prv = height[i], height[i - 1]
            if prv > threshold:
                res.append(i)
        return res