Skip to content

Commit 2085ce7

Browse files
author
wb-hjk570755
committed
一个数组中 连续的最大和
1 parent 9e69e02 commit 2085ce7

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/com/blankj/myself/ThreeSum.java

+24-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,36 @@
55
import java.util.List;
66

77
/**
8-
* Description:
8+
* Description:三数之和
99
* Copyright: Copyright (c) 2012
1010
* Company: keruyun Technology(Beijing) Chengdu Co. Ltd.
1111
*
1212
* @author huangjk
1313
* @version 1.0 2020/9/21
1414
*/
15+
16+
/**
17+
* 15. 三数之和
18+
* 给你一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c ,使得 a + b + c = 0 ?请你找出所有满足条件且不重复的三元组。
19+
20+
注意:答案中不可以包含重复的三元组。
21+
22+
 
23+
24+
示例:
25+
26+
给定数组 nums = [-1, 0, 1, 2, -1, -4],
27+
28+
满足要求的三元组集合为:
29+
[
30+
[-1, 0, 1],
31+
[-1, -1, 2]
32+
]
33+
34+
来源:力扣(LeetCode)
35+
链接:https://leetcode-cn.com/problems/3sum
36+
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
37+
*/
1538
public class ThreeSum {
1639
public List<List<Integer>> threeSum(int[] nums) {
1740
List<List<Integer>> result = new ArrayList<>();

0 commit comments

Comments
 (0)