LeetCode 18. 4Sum
Sort | Two Pointer
Given an array nums
of n integers and an integer target
, are there elements a, b, c, and d in nums
such that a + b + c + d = target
? Find all unique quadruplets in the array which gives the sum of target
.
Notice that the solution set must not contain duplicate quadruplets.
Example 1:
Example 2:
Constraints:
0 <= nums.length <= 200
-10^9 <= nums[i] <= 10^9
-10^9 <= target <= 10^9
Solution:
PreviousLeetCode 17. Letter Combinations of a Phone NumberNextLeetCode 19. Remove Nth Node From End of List
Last updated