4Sum
Find all unique quadruplets in the array which gives the sum of target.
4Sum

Find all unique quadruplets in the array which gives the sum of target.

Example 1:
Input: {"nums":[1,0,-1,0,-2,2],"target":0}
Output: [[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]
Input
arr ={"nums":[1,0,-1,0,-2,2],"target":0}
Status

Start 4Sum

Target
0
Current Sum

?

Sorted Array
1

0

0

1

-1

2

0

3

-2

4

2

5

i (first)
j (second)
L/R (two pointers)
Found
Found Quadruplets (0)
No quadruplets found yet
Variables
VariableValue
target0
DepthFunction Call
Stack empty
0/41