Microsoft Interview Question

three way partition (like selection in quicksort)