春意暖洋洋

关注

leetcode-15-3Sum

春意暖洋洋

关注

阅读 30

2023-08-23


Block me too much time, it is use two pointer to do. First is fix one numbers, then use two pointer to scan the remain sorted list and get the result. The time complexity is O(n^2). Just remember to deal with duplicate number

Update: remember, do not optimize the left and right if target != nums[left] + nums[right]


相关推荐

boom莎卡拉卡

LeetCode-15. 3Sum

boom莎卡拉卡 81 0 0

ITWYY

【LeetCode】15. 3Sum 三数之和

ITWYY 92 0 0

RJ_Hwang

[LeetCode]3Sum

RJ_Hwang 131 0 0

西曲风

Leetcode 15. 三数之和 3Sum - Python 双指针法

西曲风 43 0 0

香小蕉

【刷】leetcode 3sum问题

香小蕉 35 0 0

晴儿成长记

LeetCode-16. 3Sum Closest

晴儿成长记 82 0 0

小桥流水2016

LeeCode [15. 三数之和](https://leetcode-cn.com/problems/3sum/)

小桥流水2016 29 0 0

眸晓

【Leetcode打卡Day2】3 sum总结

眸晓 62 0 0

落花时节又逢君to

LeetCode Two Sum

落花时节又逢君to 81 0 0

大自然在召唤

LeetCode题解-Two Sum

大自然在召唤 79 0 0

精彩评论(0)

0 0 举报