Skip to content

Commit a6a505a

Browse files
committedMay 4, 2020
1351 solved
1 parent 0697726 commit a6a505a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

Diff for: ‎1351-count-negative-numbers-in-a-sorted-matrix/Article/1351-count-negative-numbers-in-a-sorted-matrix

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ var countNegatives = function(arr) {
169169

170170
## 复杂度分析
171171

172-
时间复杂度: O(m)。
172+
时间复杂度: O(mn)。 因为如果矩阵中所有的数都为正数,那么要遍历整个矩阵,所以时间复杂度是O(mn)。
173+
173174

174175
空间复杂度:O(1)。
175176

0 commit comments

Comments
 (0)