15. 3Sum
Difficulty: Medium
Given an array _S_ of _n_ integers, are there elements _a_, _b_, _c_ in _S_ such that _a_ + _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.
1 | For example, given array S = [-1, 0, 1, 2, -1, -4], |
My Solution
1 | class Solution { |