Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit134eb9b

Browse files
committed
update: 018
1 parent865cc7e commit134eb9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎note/018/README.md

Lines 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
classSolution {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp