Mental Model
Find four numbers in a list that add up to a target without repeating quadruplets. We use sorting and two pointers to efficiently find these groups.
Analogy: Imagine you have a group of friends and want to find all unique teams of four whose combined ages add up to a birthday target. You first sort them by age, then pick pairs and look for matching pairs to complete the team without repeating the same group.
Array: [1, 0, -1, 0, -2, 2] Sorted: [-2, -1, 0, 0, 1, 2] Indices: i -> 0, j -> 1, left -> 2, right -> 5 Goal: sum of values at i, j, left, right = target
