0018. 4Sum
Find all unique quadruplets that sum to target
Array:
Target:
Apply
Sort + Two Pointers
O(n^3)
Brute Force
O(n^4)
▶ Play
▮▮ Pause
▶| Step
↺ Reset
Speed:
Step:
0
Original Array
↓ sort()
Sorted Array (with pointers)
Click
Play
or
Step
to begin the animation.
Found Quadruplets
▶ Play
▮▮ Pause
▶| Step
↺ Reset
Speed:
Step:
0
Sorted Array (i, j, k, l pointers)
Click
Play
or
Step
to begin the animation.
Found Quadruplets