Maintain 2 cursors for the frontier of red and blue colors, starting at 0
and len(nums)-1.
Then for each color:
-
If it is red, swap it with red cursor. Advance red cursor and cursor.
- If it is white, just advance cursor.
-
If it is blue, swap it with blue cursor, advance blue cursor. Don’t
advance cursor.