Tags: two pointer
Problem Statement:
You are given an integer array nums
of size n
, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]]
such that:
0 <= a, b, c, d < n
a, b, c,
andd
are distinct.nums[a] + nums[b] + nums[c] + nums[d] == target
Intuition:
Read 3sum if you are completely blank
Code: