Sort Colors (Dutch Flag)

Given an array nums containing only the values 0, 1, and 2, sort it in place so that all 0s come first, followed by all 1s, and then all 2s. Return the sorted array (the same array instance may be returned).

This is the Dutch National Flag partitioning problem.

Examples
Input: [0]
Output: [0]
Hints

Sort Colors (Dutch Flag)

Given an array `nums` containing only the values `0`, `1`, and `2`, sort it **in place** so that all `0`s come first, followed by all `1`s, and then all `2`s. Return the sorted array (the same array instance may be returned).