Skip to content

Commit 8f324c5

Browse files
Merge pull request #2548 from YShelter/master
更新 Update 0142.环形链表II.md 和 Update 0454.四数相加II.md
2 parents 55e3828 + d488652 commit 8f324c5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

problems/0142.环形链表II.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
## 算法公开课
2828

29-
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[把环形链表讲清楚!| LeetCode:142.环形链表II](https://www.bilibili.com/video/BV1if4y1d7ob)相信结合视频在看本篇题解,更有助于大家对链表的理解。**
29+
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[把环形链表讲清楚!| LeetCode:142.环形链表II](https://www.bilibili.com/video/BV1if4y1d7ob)相信结合视频再看本篇题解,更有助于大家对链表的理解。**
3030

3131
## 思路
3232

problems/0454.四数相加II.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
1. 首先定义 一个unordered_map,key放a和b两数之和,value 放a和b两数之和出现的次数。
5555
2. 遍历大A和大B数组,统计两个数组元素之和,和出现的次数,放到map中。
5656
3. 定义int变量count,用来统计 a+b+c+d = 0 出现的次数。
57-
4. 在遍历大C和大D数组,找到如果 0-(c+d) 在map中出现过的话,就用count把map中key对应的value也就是出现次数统计出来。
57+
4. 再遍历大C和大D数组,找到如果 0-(c+d) 在map中出现过的话,就用count把map中key对应的value也就是出现次数统计出来。
5858
5. 最后返回统计值 count 就可以了
5959

6060
C++代码:
@@ -71,7 +71,7 @@ public:
7171
}
7272
}
7373
int count = 0; // 统计a+b+c+d = 0 出现的次数
74-
// 在遍历大C和大D数组,找到如果 0-(c+d) 在map中出现过的话,就把map中key对应的value也就是出现次数统计出来。
74+
// 再遍历大C和大D数组,找到如果 0-(c+d) 在map中出现过的话,就把map中key对应的value也就是出现次数统计出来。
7575
for (int c : C) {
7676
for (int d : D) {
7777
if (umap.find(0 - (c + d)) != umap.end()) {

0 commit comments

Comments
 (0)