You're given an array with objects colored red, white, or blue (represented as , , ). Sort them in-place so objects of the same color are adjacent, in the order red, white, blue.
You must solve this without using the library sort function. The follow-up asks: can you do it in one pass using only constant extra space?