春意暖洋洋

关注

leetcode-15-3Sum

春意暖洋洋

关注

阅读 28

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莎卡拉卡 79 0 0

ITWYY

【LeetCode】15. 3Sum 三数之和

ITWYY 90 0 0

RJ_Hwang

[LeetCode]3Sum

RJ_Hwang 129 0 0

西曲风

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

西曲风 41 0 0

香小蕉

【刷】leetcode 3sum问题

香小蕉 34 0 0

晴儿成长记

LeetCode-16. 3Sum Closest

晴儿成长记 80 0 0

小桥流水2016

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

小桥流水2016 29 0 0

眸晓

【Leetcode打卡Day2】3 sum总结

眸晓 60 0 0

落花时节又逢君to

LeetCode Two Sum

落花时节又逢君to 80 0 0

互联网码农

【Leetcode】Combination Sum II

互联网码农 44 0 0

精彩评论(0)

0 0 举报