Problem 2161 · Medium

Partition Array According to Given Pivot

Reorder the values so those below a pivot come first, equal values follow, and those above come last, keeping each group in its original order. The visual splits the array into three lanes.

Open the interactive visualisation