跳到主要内容

3285.找到稳定山的下标

链接:3285.找到稳定山的下标
难度:Easy
标签:数组
简介:请你返回一个数组,包含所有 稳定 山的下标,你可以以 任意 顺序返回下标数组。

题解 1 - python

  • 编辑时间:2024-12-19
  • 内存消耗:17.44MB
  • 编程语言:python
  • 解法介绍:遍历
class Solution:
def stableMountains(self, height: List[int], threshold: int) -> List[int]:
return [i for i in range(1, len(height)) if height[i - 1] > threshold]