Skip to content

Commit 7db5226

Browse files
authored
Update 11.container-with-most-water.md
1 parent 0d5a2ef commit 7db5226

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

problems/11.container-with-most-water.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ JavaScript Code:
116116
var maxArea = function(height) {
117117
if (!height || height.length <= 1) return 0;
118118

119-
// 双指针来进行优化
120-
// 时间复杂度是O(n)
121119
let leftPos = 0;
122120
let rightPos = height.length - 1;
123121
let max = 0;
@@ -154,3 +152,12 @@ public:
154152
}
155153
};
156154
```
155+
156+
***复杂度分析***
157+
- 时间复杂度:$O(N)$
158+
- 空间复杂度:$O(1)$
159+
160+
161+
大家也可以关注我的公众号《脑洞前端》获取更多更新鲜的LeetCode题解
162+
163+
![](https://pic.leetcode-cn.com/89ef69abbf02a2957838499a96ce3fbb26830aae52e3ab90392e328c2670cddc-file_1581478989502)

0 commit comments

Comments
 (0)