Recently while going through interview questions, I came across this interesting
problem - Called 3-way partitioning or also called as a Dutch National flag
problem.
In gist, the problem is given an array containing 3 distinct elements, (Say 0, 1
and 2) sort them in the increasing order. When you