Last updated
Was this helpful?
Last updated
Was this helpful?
Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.
Note:The solution set must not contain duplicate triplets.
这是2 sum的延伸,还是用2 pointer来解决。O(n^2)