Skip to content

Commit 1ebc647

Browse files
author
robot
committed
fix: 图床修复
1 parent e0e438d commit 1ebc647

File tree

393 files changed

+1146
-1146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

393 files changed

+1146
-1146
lines changed

91/binary-search.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,9 @@ target 在右侧有序部分,我们就可以舍弃左边部分了(通过 start
779779

780780
我们以([6,7,8,1,2,3,4,5], 4)为例讲解一下:
781781

782-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gh9ahf86uyj30if0b0t9w.jpg)
782+
![](https://p.ipic.vip/e1eqm5.jpg)
783783

784-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gh9ahoznqjj30gx0i2wgb.jpg)
784+
![](https://p.ipic.vip/gmsqw5.jpg)
785785

786786
接下来,我们考虑重复元素的问题。如果存在重复数字,就可能会发生 nums[mid] ==
787787
nums[start] 了,比如 30333 。这个时候可以选择舍弃 start,也就是 start 右移一位。
@@ -1059,7 +1059,7 @@ class Solution:
10591059

10601060
2. 如果中间元素 > 数组第一个元素,我们需要在 mid 右边搜索。
10611061

1062-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gh99umkpjcj30q20c8aak.jpg)
1062+
![](https://p.ipic.vip/e5lrsi.jpg)
10631063

10641064
- 如果中间元素 <= 数组第一个元素,我们需要在 mid 左边搜索。
10651065

@@ -1071,7 +1071,7 @@ class Solution:
10711071

10721072
- nums[mid - 1] > nums[mid],因此 mid 是最小值。
10731073

1074-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gh99yah60sj30mq0aidg8.jpg)
1074+
![](https://p.ipic.vip/c524lk.jpg)
10751075

10761076
###### 代码(Python)
10771077

@@ -1129,7 +1129,7 @@ class Solution:
11291129
最简单的,如果这个二叉树是一个二叉搜索树(BST)。 那么实际上,在一个二叉搜索树种
11301130
进行搜索的过程就是二分法。
11311131

1132-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlvp2whsdj30zk0tngoh.jpg)
1132+
![](https://p.ipic.vip/bd2rnk.jpg)
11331133

11341134
如上图,我们需要在这样一个二叉搜索树中搜索 7。那么我们的搜索路径则会是 8 -> 3 ->
11351135
6 -> 7,这也是一种二分法。只不过相比于普通的**有序序列查找给定值**二分, 其时间
@@ -1138,13 +1138,13 @@ class Solution:
11381138
上面讲了二叉搜索树,我们再来看一种同样特殊的树 - 完全二叉树。 如果我们给一颗完全
11391139
二叉树的所有节点进行编号(二进制),依次为 01,10,11, ...。
11401140

1141-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlwv88wl2j30g508ht9m.jpg)
1141+
![](https://p.ipic.vip/exnxz6.jpg)
11421142

11431143
那么实际上,最后一行的编号就是从根节点到该节点的路径。 其中 0 表示向左, 1 表示
11441144
向右。(第一位数字不用)。 我们以最后一行的 101 为例,我们需要执行一次左,然后一次
11451145
右。
11461146

1147-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlwu1qyklj30ex081758.jpg)
1147+
![](https://p.ipic.vip/z5fob9.jpg)
11481148

11491149
其实原理也不难,如果你用数组表示过完全二叉树,那么就很容易理解。 我们可以发现,左节点的编号都是父节点的二倍,并且右节点都是父节点的二倍 + 1。从二进制的角度来看就是:**父节点的编号左移一位就是左节点的编号,左移一位 + 1 就是右节点的编号**。 因此反过来, 知道了子节点的最后一位,我们就能知道它是父节点的左节点还是右节点啦。
11501150

91/season2.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
群里每天都会有题目,推荐大家讨论当天的题目。我们会帮助大家规划学习路线,91 天见证不一样的自己。群里会有专门的资深算法竞赛大佬坐阵解答大家的问题和疑问,并且会对前一天的题目进行讲解。
1212

13-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gf2b2zkclnj30xm0b6aat.jpg)
13+
![](https://p.ipic.vip/7zxu6v.jpg)
1414

1515
## 活动时间
1616

@@ -33,7 +33,7 @@
3333
3434
## 课程大纲
3535

36-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1giq98aux20j30ju0qt781.jpg)
36+
![](https://p.ipic.vip/bno0ye.jpg)
3737

3838
第一期部分公开的讲义:
3939

91/two-pointers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ for(int i = 0;i < nums.size(); i++) {
1616
}
1717
```
1818

19-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gf5w79tciyj30aa0hl77b.jpg)
19+
![](https://p.ipic.vip/s306f5.jpg)
2020

2121
(图 1)
2222

@@ -35,7 +35,7 @@ while (l < r) {
3535
return l
3636
```
3737

38-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gf5yfe9da7j307504ut8r.jpg)
38+
![](https://p.ipic.vip/duhwzn.jpg)
3939

4040
(图 2)
4141

README.en.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# LeetCode
22

3-
[![Travis](https://img.shields.io/badge/language-C++-green.svg)]() [![Travis](https://img.shields.io/badge/language-JavaScript-yellow.svg)]() [![Travis](https://img.shields.io/badge/language-Python-red.svg)]() [![Travis](https://img.shields.io/badge/language-Java-blue.svg)]() ![Total visitor](https://visitor-count-badge.herokuapp.com/total.svg?repo_id=azl397985856.leetcode.en) ![Visitors in today](https://visitor-count-badge.herokuapp.com/today.svg?repo_id=azl397985856.leetcode.en)
3+
[![Travis](https://p.ipic.vip/hnzzr3.jpg)]() [![Travis](https://p.ipic.vip/3zihse.jpg)]() [![Travis](https://p.ipic.vip/hh8zzk.jpg)]() [![Travis](https://p.ipic.vip/gd28pb.jpg)]() ![Total visitor](https://visitor-count-badge.herokuapp.com/total.svg?repo_id=azl397985856.leetcode.en) ![Visitors in today](https://visitor-count-badge.herokuapp.com/today.svg?repo_id=azl397985856.leetcode.en)
44

55
> since 2019-09-03 19:40
66
77
[简体中文](./README.md) | English
88

99
---
1010

11-
![leetcode.jpeg](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwf4xivj30dw0780sm.jpg)
11+
![leetcode.jpeg](https://p.ipic.vip/u6nhhh.jpg)
1212

1313
This essay records the course of and my emotion to this project from initialization to 10,000 stars. [Milestone for 10,000+ stars](./thanksGiving.md)
1414

1515
If you are interested in this project, **do not mean your star**. This project will be **supported for a long enough time** by the community. Thanks for every audience and contributor.
1616

1717
## Introduction
1818

19-
![leetcode.jpeg](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwf4xivj30dw0780sm.jpg)
19+
![leetcode.jpeg](https://p.ipic.vip/u6nhhh.jpg)
2020

2121
LeetCode Solutions: A Journey of Problem Solving.
2222

@@ -49,7 +49,7 @@ If you want to do some contributions or collaborations, just feel free to contac
4949
- Here will be the place to update Anki Flashcards in the future as well.
5050
- Here is a mind mapping graph showing the summary of categorizations of problems that are questioned frequently in interviews. We could analyze according to the information in the graph.
5151

52-
![leetcode-zhihu](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwgi53bj30k00jx0te.jpg)
52+
![leetcode-zhihu](https://p.ipic.vip/58vm3a.jpg)
5353

5454
(Picture credited by [LeetCode-cn](https://www.zhihu.com/question/24964987/answer/586425979).)
5555

@@ -74,15 +74,15 @@ The data structures mainly include:
7474

7575
[0547.friend-circles](./problems/547.friend-circles-en.md) :
7676

77-
![friend circle BFS](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwh1getj30u0140tdc.jpg)
77+
![friend circle BFS](https://p.ipic.vip/5gg5y0.jpg)
7878

7979
[backtrack problems](./problems/90.subsets-ii-en.md):
8080

81-
![backtrack](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwhwowgj30n20nptas.jpg)
81+
![backtrack](https://p.ipic.vip/w5g03x.jpg)
8282

8383
[0454.4-sum-ii](./problems/454.4-sum-ii.en.md) :
8484

85-
![454.4-sum-ii](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwivf65j30le0deab3.jpg)
85+
![454.4-sum-ii](https://p.ipic.vip/vaniw4.jpg)
8686

8787
## Portals
8888

@@ -177,11 +177,11 @@ We're still on the early stage, so feedback from community is very welcome. For
177177

178178
### QQ (For China Region)
179179

180-
![qq-group-chat](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwje9plj3060060wel.jpg)
180+
![qq-group-chat](https://p.ipic.vip/k88y70.jpg)
181181

182182
### WeChat (For China Region)
183183

184-
![wechat-group-chat](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwjrk6ij30e80e875j.jpg)
184+
![wechat-group-chat](https://p.ipic.vip/d621ys.jpg)
185185

186186
(Add this bot and reply "leetcode" to join the group.)
187187

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# LeetCode
22

3-
[![Travis](https://img.shields.io/badge/language-C++-green.svg)]() [![Travis](https://img.shields.io/badge/language-Python-red.svg)]() [![Travis](https://img.shields.io/badge/language-Java-blue.svg)]() [![Travis](https://img.shields.io/badge/language-Go-red.svg)]() [![Travis](https://img.shields.io/badge/language-Php-pink.svg)]() [![Travis](https://img.shields.io/badge/language-JavaScript-yellow.svg)]()
3+
[![Travis](https://p.ipic.vip/k4pv1r.jpg)]() [![Travis](https://p.ipic.vip/32nfgh.jpg)]() [![Travis](https://p.ipic.vip/4a36ao.jpg)]() [![Travis](https://p.ipic.vip/fd1f82.jpg)]() [![Travis](https://p.ipic.vip/mhz5uy.jpg)]() [![Travis](https://p.ipic.vip/gp1hvz.jpg)]()
44

5-
[![](https://img.shields.io/badge/WeChat-微信群-brightgreen)](#哪里能找到我) [![](https://img.shields.io/badge/公众号-力扣加加-blueviolet)](#哪里能找到我) [![](https://img.shields.io/badge/Juejin-掘金-blue)](https://juejin.im/user/58af98305c497d0067780b3b) [![](https://img.shields.io/badge/Zhihu-知乎-blue)](https://www.zhihu.com/people/lu-xiao-13-70) [![](https://img.shields.io/badge/bilili-哔哩哔哩-ff69b4)](https://space.bilibili.com/519510412/)
5+
[![](https://img.shields.io/badge/WeChat-微信群-brightgreen)](#哪里能找到我) [![](https://img.shields.io/badge/公众号-力扣加加-blueviolet)](#哪里能找到我) [![](https://img.shields.io/badge/Juejin-掘金-blue)](https://p.ipic.vip/pj4t8y.jpg) [![](https://img.shields.io/badge/Zhihu-知乎-blue)](https://p.ipic.vip/n9co7k.jpg) [![](https://img.shields.io/badge/bilili-哔哩哔哩-ff69b4)](https://p.ipic.vip/m7g3to.jpg)
66

77
简体中文 | [English](./README.en.md)
88

@@ -14,7 +14,7 @@
1414

1515
我的新书《算法通关之路》出版了。
1616

17-
![](https://tva1.sinaimg.cn/large/008i3skNly1gu39d1zb7qj622g0u013a02.jpg)
17+
![](https://p.ipic.vip/zo8cz5.jpg)
1818

1919
- [实体版购书链接 1](https://union-click.jd.com/jdc?e=618|pc|&p=JF8BAOAJK1olXgEGUV9cAE4VCl8IGloXWgYCV1tcAE8TBl9MRANLAjZbERscSkAJHTdNTwcKBlMdBgABFksWAm0PG1sWWAcKUFpYFxJSXzI4GAhrA0IDUiM-FjFxQQtKWFx2AlkYElJROEonA24JG1MQWgMEUW5tCEwnQgEIGlkdXAQHUW5cOEsQBmkNElwWXgYGUFxtD0seMzRddVwVWFVWB10PXxtDVDo4K2sWbQECXRMcWgYnM284GGtXMwUKAw5VDEpDA2oBGl4SXwELUF5fCkkQVDtdH1JGX1EAZFxcCU8eMw)
2020

@@ -28,7 +28,7 @@
2828

2929
[在线阅读地址](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/)
3030

31-
![](https://tva1.sinaimg.cn/large/0081Kckwly1gm3r7y4dt8j30zx0u0hdt.jpg)
31+
![](https://p.ipic.vip/x1u80k.jpg)
3232

3333
**限时免费下载!后期随时可能收费**
3434

@@ -46,15 +46,15 @@
4646

4747
## 九章算法班
4848

49-
![](https://tva1.sinaimg.cn/large/e6c9d24ely1h5bw2q7urhj20m803ct8z.jpg)
49+
![](https://p.ipic.vip/iyzbvl.jpg)
5050

5151
九章算法,由北大、清华校友于美国硅谷创办,已帮助数十万 IT 程序员找到高薪 offer! 提供 1 对 1 求职指导、算法指导、前后端项目、简历代笔等服务。
5252

5353
- 推荐刷题网站:[www.lintcode.com](https://www.lintcode.com/?utm_source=tf-github-lucifer2022), 戳此免费领取 7 天[LintCode 超级 Vip](https://www.lintcode.com/vip/activity/zWIMOY)
5454

5555
- 推荐北大 FB 双料大神的[《九章算法班》](https://www.jiuzhang.com/course/71/?utm_source=tf-github-lucifer2022),有人靠他连拿 3 个大厂 offer
5656

57-
![](https://tva1.sinaimg.cn/large/e6c9d24ely1h5bw3rtr9oj20m807sdgp.jpg)
57+
![](https://p.ipic.vip/8a4bul.jpg)
5858

5959
## :calendar:《91 天学算法》限时活动
6060

@@ -66,7 +66,7 @@
6666

6767
[点此参与](https://github.com/azl397985856/leetcode/discussions/532)
6868

69-
![](https://tva1.sinaimg.cn/large/008i3skNly1gq0mm4lscqj313h0r0diy.jpg)
69+
![](https://p.ipic.vip/ltkyaq.jpg)
7070

7171
- 🔥🔥🔥🔥 [活动首页](https://leetcode-solution.cn/91) 🔥🔥🔥🔥
7272
- [91 第三期讲义 - 二分专题(上)](./thinkings/binary-search-1.md)
@@ -96,7 +96,7 @@ leetcode 题解,记录自己的 leetcode 解题之路。
9696

9797
- 这里有一张互联网公司面试中经常考察的问题类型总结的思维导图,我们可以结合图片中的信息分析一下。
9898

99-
![leetcode-zhihu](https://tva1.sinaimg.cn/large/007S8ZIlly1ghluennxvrj30k00jx0te.jpg)
99+
![leetcode-zhihu](https://p.ipic.vip/a20o3x.jpg)
100100

101101
(图片来自 leetcode)
102102

@@ -570,7 +570,7 @@ anki - 文件 - 导入 - 下拉格式选择“打包的 anki 集合”,然后
570570

571571
大家也可以加我微信好友进行交流!
572572

573-
![](https://tva1.sinaimg.cn/large/008i3skNly1gx11szd02ej30e80e8dg3.jpg)
573+
![](https://p.ipic.vip/wciz1n.jpg)
574574

575575
## :chart_with_upwards_trend: 大事件
576576

@@ -581,7 +581,7 @@ anki - 文件 - 导入 - 下拉格式选择“打包的 anki 集合”,然后
581581
- 2020-04-12: [项目突破三万 Star](./thanksGiving3.md)
582582
- 2020-04-14: 官网`力扣加加`上线啦 💐💐💐💐💐,有专题讲解,每日一题,下载区和视频题解,后续会增加更多内容,还不赶紧收藏起来?地址:<http://leetcode-solution.cn/>
583583

584-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghluemaoj3j30z90dtmy5.jpg)
584+
![](https://p.ipic.vip/98p19b.jpg)
585585

586586
- 2021-02-23: star 破四万
587587

daily/2019-06-27.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function sqrt(num) {
5252
也就是说,函数上任一点(x,f(x))处的切线斜率是2x。
5353
那么,x-f(x)/(2x)就是一个比x更接近的近似值。代入 f(x)=x^2-a得到x-(x^2-a)/(2x),也就是(x+a/x)/2。
5454

55-
![2019-06-27](https://tva1.sinaimg.cn/large/007S8ZIlly1ghludzm5xsg30ip0dct9s.gif)
55+
![2019-06-27](https://p.ipic.vip/cs2twn.gif)
5656

5757
(图片来自Wikipedia)
5858

daily/2019-07-10.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
这个题目解释起来比较费劲,我在网上找了一个现成的图来解释一下:
3030

31-
![weight-ball](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlue317j6j30d80dcta4.jpg)
31+
![weight-ball](https://p.ipic.vip/4r85gu.jpg)
3232

3333
图中“1+”是指“1号小球为重”这一可能性。“1-”是指“1号小球为轻”这一可能性。
3434
一开始一共有24种可能性。

daily/2019-07-23.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
```
1616

17-
![2019-07-23](https://tva1.sinaimg.cn/large/007S8ZIlly1ghludxwb1aj30py1hc0tr.jpg)
17+
![2019-07-23](https://p.ipic.vip/ynwmml.jpg)
1818

1919
## 参考答案
2020

daily/2019-07-26.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## 题目描述
1010

11-
![2019-07-26](https://tva1.sinaimg.cn/large/007S8ZIlly1ghludytrtlj30py1hcas1.jpg)
11+
![2019-07-26](https://p.ipic.vip/2r3uxg.jpg)
1212

1313
## 参考答案
1414

daily/2019-07-29.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Example 2:
3737
2. row->col、col->row 的切换都伴随读取的初始位置的变化;
3838
3. 结束条件是row头>row尾或者col顶>col底
3939

40-
![剥洋葱](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlue0ni96j30b00bdq35.jpg)
40+
![剥洋葱](https://p.ipic.vip/l0rqs7.jpg)
4141

4242
时间复杂度O(m*n), 空间复杂度O(1)
4343

daily/2019-07-30.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
那么沿着这条纬线(记为E纬线)上任意一点向东走一英里,始终会回到原点,只是走的圈数不同而已。
2323
根据题目倒推,在这条纬线以北一英里存在一条纬线(记为N纬线),从N纬线的任意一点向南一英里到达E纬线W点,沿着E纬线向东一英里,必会回到W点,再向北走一英里恰好可以回到起点。北极点可能包含在这个集合中,也可能不在。
2424
如下图示供参考:
25-
![earth-problem](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlue5gt6uj30u01441l0.jpg)
25+
![earth-problem](https://p.ipic.vip/v0xcjn.jpg)
2626

2727
所以答案是无数个点
2828

daily/2019-08-13.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ m 和 n =150,肯定超时。
6161

6262
最后将探测结果进行合并即可。合并的条件就是当前单元既能流入太平洋又能流入大西洋。
6363

64-
![集合](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlue21s7aj30dw08cglo.jpg)
64+
![集合](https://p.ipic.vip/r02fm7.jpg)
6565
扩展:
6666

6767
如果题目改为能够流入大西洋或者太平洋,我们只需要最后合并的时候,条件改为求或即可

epilogue.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
关注公众号《力扣加加》带你啃下算法这块硬骨头。
1010

11-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gfcuzagjalj30p00dwabs.jpg)
11+
![](https://p.ipic.vip/iiew7e.jpg)
1212

1313
lucifer 的博客地址:https://lucifer.ren/blog/

introduction.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010

1111
我的新书《算法通关之路》出版了。这本书和本仓库内容几乎没有任何重叠,采用 Python 编写,不过也提供了 Java,CPP 以及 JS 代码供大家参考。
1212

13-
![](https://tva1.sinaimg.cn/large/008i3skNly1gu39d1zb7qj622g0u013a02.jpg)
13+
![](https://p.ipic.vip/l9sxsa.jpg)
1414

1515
[图书介绍](https://mp.weixin.qq.com/s?__biz=MzI4MzUxNjI3OA==&mid=2247489484&idx=1&sn=a16664605744a970f8a81e64affb01a7&chksm=eb88dbd5dcff52c3ecee38c7f594df6d16ed7ca2852ad4d0d86bab99483f4413c30e98b00e43&token=715489125&lang=zh_CN#rd)
1616

1717
大家也可以扫描下方二维码购买。
1818

19-
![](https://tva1.sinaimg.cn/large/008i3skNly1gu3sf6szzij60dw0i2aax02.jpg)
19+
![](https://p.ipic.vip/ny26q0.jpg)
2020

2121
## 电子书
2222

2323
[在线阅读](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/)
2424

2525
这是我将我的所有公开的算法资料整理的一个电子书,全部题目信息中文化,以前会有一些英文描述,感谢 @CYL 的中文整理。
2626

27-
![](https://tva1.sinaimg.cn/large/0081Kckwly1gm3r7y4dt8j30zx0u0hdt.jpg)
27+
![](https://p.ipic.vip/1nxfdk.jpg)
2828

2929
**限时免费下载!后期随时可能收费**
3030

@@ -74,7 +74,7 @@ leetcode 题解,记录自己的 leetcode 解题之路。
7474
- 对于最近更新的部分, 后面会有 🖊 标注
7575
- 这里有一张互联网公司面试中经常考察的问题类型总结的思维导图,我们可以结合图片中的信息分析一下。
7676

77-
![leetcode-zhihu](https://tva1.sinaimg.cn/large/007S8ZIlly1ghluennxvrj30k00jx0te.jpg)
77+
![leetcode-zhihu](https://p.ipic.vip/pe0egq.jpg)
7878

7979
(图片来自 leetcode)
8080

@@ -544,7 +544,7 @@ anki - 文件 - 导入 - 下拉格式选择“打包的 anki 集合”,然后
544544
- 2020-04-12: [项目突破三万 Star](./thanksGiving3.md)
545545
- 2020-04-14//leetcode-solution.cn/
546546

547-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghluemaoj3j30z90dtmy5.jpg)
547+
![](https://p.ipic.vip/pq92y4.jpg)
548548

549549
- 2021-02-23: star 破四万
550550

problems/1.two-sum.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ class Solution:
158158

159159
关注公众号力扣加加,努力用清晰直白的语言还原解题思路,并且有大量图解,手把手教你识别套路,高效刷题。
160160

161-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gfcuzagjalj30p00dwabs.jpg)
161+
![](https://p.ipic.vip/2tzysv.jpg)

problems/1004.max-consecutive-ones-iii.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ class Solution:
131131

132132
关注公众号力扣加加,努力用清晰直白的语言还原解题思路,并且有大量图解,手把手教你识别套路,高效刷题。
133133

134-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gfcuzagjalj30p00dwabs.jpg)
134+
![](https://p.ipic.vip/d00epc.jpg)

problems/101.symmetric-tree.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ https://leetcode-cn.com/problems/symmetric-tree/
5353

5454
看到这题的时候,我的第一直觉是 DFS。然后我就想:`如果左子树是镜像,并且右子树也是镜像,是不是就说明整体是镜像?`。经过几秒的思考, 这显然是不对的,不符合题意。
5555

56-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlu96e83wj31200iugme.jpg)
56+
![](https://p.ipic.vip/bke0ic.jpg)
5757

5858
很明显其中左子树中的节点会和右子树中的节点进行比较,我把比较的元素进行了颜色区分,方便大家看。
5959

6060
这里我的想法是:`遍历每一个节点的时候,如果我都可以通过某种方法知道它对应的对称节点是谁,这样的话我直接比较两者是否一致就行了。`
6161

6262
因此想法是两次遍历,第一次遍历的同时将遍历结果存储到哈希表中,然后第二次遍历去哈希表取。这种方法可行,但是需要 N 的空间(N 为节点总数)。我想到如果两者可以同时进行遍历,是不是就省去了哈希表的开销。
6363

64-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlu9a7sy7j31a30u0408.jpg)
64+
![](https://p.ipic.vip/b9e8xo.jpg)
6565

6666
如果不明白的话,我举个简单例子:
6767

@@ -199,6 +199,6 @@ class Solution:
199199

200200
大家对此有何看法,欢迎给我留言,我有时间都会一一查看回答。更多算法套路可以访问我的 LeetCode 题解仓库:https://github.com/azl397985856/leetcode 。 目前已经 37K star 啦。
201201
大家也可以关注我的公众号《力扣加加》带你啃下算法这块硬骨头。
202-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gfcuzagjalj30p00dwabs.jpg)
202+
![](https://p.ipic.vip/m2fbex.jpg)
203203

204-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghlu9b4p9ej30x20iwjtf.jpg)
204+
![](https://p.ipic.vip/ee9bkp.jpg)

0 commit comments

Comments
 (0)