Mental Model
We use two pointers to separate three groups by swapping elements in one pass. This avoids extra space and multiple passes.
Analogy: Imagine sorting red, white, and blue balls into three bins by moving balls between bins with two hands, one hand placing reds and the other placing blues, leaving whites in the middle.
Index: 0 1 2 3 4 5 6 Array: R W B W R B W Pointers: low ↑ mid ↑ high ↑ (R=red=0, W=white=1, B=blue=2)
