Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3faf59e

Browse files
2 parents d1f1366 + c98da14 commit 3faf59e

File tree

1 file changed

+3
-3
lines changed
  • solution/0955.Delete Columns to Make Sorted II

1 file changed

+3
-3
lines changed

‎solution/0955.Delete Columns to Make Sorted II/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ class Solution {
110110

111111
#### 优化解法
112112

113-
上述解法需要我们在 isSorted 方法中一直需要遍历现存元素的字符串长度来做到判定该数组是否已经 sorted,有没有更优化的方法让我们可以避免重复的遍历呢?思考下面的情况,对于
113+
上述解法需要我们在 isSorted 方法中一直需要遍历现存元素的字符串长度来做到判定该数组是否已经 sorted,有没有更优化的方法让我们可以避免重复的遍历呢?思考下面的情况,对于数组
114114

115115
```
116116
A = ["ar", "ax", "be", "bf", "bg"]
117117
```
118118

119-
的数组,我们发现在我们决定可以保留第一个字符之后,后面要保证其 sorted 的条件可以简化为:
119+
我们发现在我们决定可以保留第一个字符之后,后面要保证其 sorted 的条件可以简化为:
120120

121121
```
122122
A[0] <= A[1] and A[2] <= A[3] <= A[4]
@@ -152,4 +152,4 @@ class Solution {
152152
}
153153
```
154154

155-
解法只用到了额外的 cut boolean 数组,空间复杂度为 O(M),时间复杂度为 O(NM),其中 N 为 word 长度,M 为数组长度。
155+
解法只用到了额外的 cut boolean 数组,空间复杂度为 O(M),时间复杂度为 O(NM),其中 N 为 word 长度,M 为数组长度。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /