Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 134eb9b

Browse filesBrowse files
committed
update: 018
1 parent 865cc7e commit 134eb9b
Copy full SHA for 134eb9b

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎note/018/README.md

Copy file name to clipboardExpand all lines: note/018/README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A solution set is:
2222

2323
## 思路 0
2424

25-
这道题和 [3Sum][015] 的思路基本一样,先对数组进行排序,然后遍历这个排序数组,因为这次是四个元素的和,所以外层需要两重循环,然后还是用两个指针分别指向当前元素的下一个和数组尾部,判断四者的和与 `target` 的大小来移动两个指针,其中细节操作还是优化和去重。
25+
题意是让你从数组中找出所有四个数的和为 `target` 的元素构成的非重复序列,该题和 [3Sum][015] 的思路基本一样,先对数组进行排序,然后遍历这个排序数组,因为这次是四个元素的和,所以外层需要两重循环,然后还是用两个指针分别指向当前元素的下一个和数组尾部,判断四者的和与 `target` 的大小来移动两个指针,其中细节操作还是优化和去重。
2626

2727
```java
2828
class Solution {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.