Intuition
3Sum is 'fix one, two-pointer the rest'. 4Sum is the same idea one level up: fix the first two numbers with nested loops, then close the remaining pair with converging pointers on the sorted array. Sorting is what makes both the pointer walk and duplicate-skipping possible.
Approach
Sort first
Sorting lets converging pointers steer by sum (too small → move left pointer up, too big → move right pointer down) and puts duplicates next to each other so they're easy to skip.
Fix i and j, two-pointer l and r
For each pair (i, j), find pairs (l, r) in the suffix with nums[l]+nums[r] == target − nums[i] − nums[j]. That inner search is linear.
Skip duplicates at every level
After using a value at position i, j, l, or r, advance past equal neighbours. This produces unique quadruplets without a set.
Solution & live demo
Edge cases
Loops never produce a quadruple; returns [].
Python ints are unbounded; elsewhere use 64-bit sums.