File tree 5 files changed +11
-7
lines changed
5 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ leetcode 题解,记录自己的 leetcode 解题之路。
343
343
- [ 0547. 朋友圈] ( ./problems/547.friend-circles.md )
344
344
- [ 0560. 和为 K 的子数组] ( ./problems/560.subarray-sum-equals-k.md )
345
345
- [ 0609. 在系统中查找重复文件] ( ./problems/609.find-duplicate-file-in-system.md )
346
- - [ 0611. 有效三角形的个数] ( ./problems/611.valid-triangle-number.md )
346
+ - [ 0611. 有效三角形的个数] ( ./problems/611.valid-triangle-number.md ) 👍
347
347
- [ 0673. 最长递增子序列的个数] ( ./problems/673.number-of-longest-increasing-subsequence.md )
348
348
- [ 0686. 重复叠加字符串匹配] ( ./problems/686.repeated-string-match.md )
349
349
- [ 0718. 最长重复子数组] ( ./problems/718.maximum-length-of-repeated-subarray.md )
Original file line number Diff line number Diff line change 190
190
- [ 0516. 最长回文子序列] ( ./problems/516.longest-palindromic-subsequence.md )
191
191
- [ 0513. 找树左下角的值] ( ./problems/513.find-bottom-left-tree-value.md ) 91
192
192
- [ 0518. 零钱兑换 II] ( ./problems/518.coin-change-2.md )
193
- - [ 0547. 朋友圈] ( ./problems/547.friend-circles.md ) 👍
193
+ - [ 0547. 朋友圈] ( ./problems/547.friend-circles.md )
194
194
- [ 0560. 和为 K 的子数组] ( ./problems/560.subarray-sum-equals-k.md )
195
195
- [ 0609. 在系统中查找重复文件] ( ./problems/609.find-duplicate-file-in-system.md )
196
- - [ 0611. 有效三角形的个数] ( ./problems/611.valid-triangle-number.md )
196
+ - [ 0611. 有效三角形的个数] ( ./problems/611.valid-triangle-number.md ) 👍
197
197
- [ 0673. 最长递增子序列的个数] ( ./problems/673.number-of-longest-increasing-subsequence.md )
198
198
- [ 0686. 重复叠加字符串匹配] ( ./problems/686.repeated-string-match.md )
199
199
- [ 0714. 买卖股票的最佳时机含手续费] ( ./problems/714.best-time-to-buy-and-sell-stock-with-transaction-fee.md ) 👍
Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ for i in range(n - 2):
124
124
125
125
由于 K 不会后退,因此最内层循环总共最多执行 N 次,因此总的时间复杂度为 $O(N ^ 2)$。
126
126
127
+ 这种技巧在很多题目中都出现过,值得引起大家的重视。比如 [ 84. 柱状图中最大的矩形] ( https://github.com/azl397985856/leetcode/blob/master/problems/84.largest-rectangle-in-histogram.md ) 中的 优化中心扩展法
128
+
127
129
> 这个复杂度分析有点像单调栈,大家可以结合起来理解。
128
130
129
131
### 关键点分析
Original file line number Diff line number Diff line change @@ -216,7 +216,8 @@ class Solution:
216
216
217
217
## 相关题目
218
218
219
- - [ 42.trapping-rain-water] ( https://github.com/azl397985856/leetcode/blob/master/problems/42.trapping-rain-water.md )
219
+ - [ 42. 接雨水] ( https://github.com/azl397985856/leetcode/blob/master/problems/42.trapping-rain-water.md )
220
+ - [ 85. 最大矩形] ( https://github.com/azl397985856/leetcode/blob/master/problems/85.maximal-rectangle.md )
220
221
221
222
大家对此有何看法,欢迎给我留言,我有时间都会一一查看回答。更多算法套路可以访问我的 LeetCode 题解仓库:https://github.com/azl397985856/leetcode 。 目前已经 37K star 啦。
222
223
大家也可以关注我的公众号《力扣加加》带你啃下算法这块硬骨头。
Original file line number Diff line number Diff line change @@ -93,8 +93,9 @@ class Solution:
93
93
- 时间复杂度:$O(M * N)$
94
94
- 空间复杂度:$O(N)$
95
95
96
- 以上就是本文的全部内容了。大家对此有何看法,欢迎给我留言,我有时间都会一一查看回答。更多算法套路可以访问我的 LeetCode 题解仓库: https://github.com/azl397985856/leetcode 。 目前已经 38K star 啦。大家也可以关注我的公众号《力扣加加》带你啃下算法这块硬骨头。
96
+ ## 相关题目
97
97
98
- ```
98
+ - [ 42. 接雨水] ( https://github.com/azl397985856/leetcode/blob/master/problems/42.trapping-rain-water.md )
99
+ - [ 84. 柱状图中最大的矩形] ( https://github.com/azl397985856/leetcode/blob/master/problems/84.largest-rectangle-in-histogram.md )
99
100
100
- ```
101
+ 以上就是本文的全部内容了。大家对此有何看法,欢迎给我留言,我有时间都会一一查看回答。更多算法套路可以访问我的 LeetCode 题解仓库: https://github.com/azl397985856/leetcode 。 目前已经 38K star 啦。大家也可以关注我的公众号《力扣加加》带你啃下算法这块硬骨头。
You can’t perform that action at this time.
0 commit comments