LetCode算法日记——15. 三数之和
一、题目描述
给你一个包含 n 个整数的数组nums,判断nums中是否存在三个元素 a,b,c ,使得a + b + c = 0 ?请你找出所有和为 0 且不重复的三元组。
二、示例
输入:nums = [-1,0,1,2,-1,-4]
输出:[[-1,-1,2],[-1,0,1]]
三、 python3代码
class Solution:
def threeSum(self, nums: List[int]) ->...
原创
2021-09-06 21:41:52 ·
86 阅读 ·
0 评论