Approach hintTry it first, then revealHide
Partition in one pass with three indices: everything before low is 0, everything after high is 2, and mid scans the unknown region between them. After swapping with high, examine mid again before advancing.