Skip to content

Commit 1dc57cd

Browse files
committed
fix: update
1 parent 9ae2a76 commit 1dc57cd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

solution/3200-3299/3285.Find Indices of Stable Mountains/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3285.Fi
6969

7070
<!-- solution:start -->
7171

72-
### 方法一
72+
### 方法一:遍历
73+
74+
我们直接从下标为 $1$ 的山开始遍历,如果它左侧相邻的山的高度大于 $threshold$,那么我们就将它的下标加入到结果数组中。
75+
76+
遍历结束后,返回结果数组即可。
77+
78+
时间复杂度 $O(n)$,其中 $n$ 是数组 $\textit{height}$ 的长度。忽略答案数组的空间消耗,空间复杂度 $O(1)$。
7379

7480
<!-- tabs:start -->
7581

solution/3200-3299/3285.Find Indices of Stable Mountains/README_EN.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3285.Fi
6767

6868
<!-- solution:start -->
6969

70-
### Solution 1
70+
### Solution 1: Traversal
71+
72+
We directly traverse the mountains starting from index $1$. If the height of the mountain to its left is greater than $threshold$, we add its index to the result array.
73+
74+
After the traversal, we return the result array.
75+
76+
The time complexity is $O(n)$, where $n$ is the length of the array $\textit{height}$. Ignoring the space consumption of the result array, the space complexity is $O(1)$.
7177

7278
<!-- tabs:start -->
7379

0 commit comments

Comments
 (0)