66. Sort 0s, 1s and 2s (Dutch National Flag)
MediumSorting
nums contains only 0, 1 and 2. Sort it in one pass with O(1) extra space and return it.
Example 1
Input: nums = [2, 0, 2, 1, 1, 0] Output: [0, 0, 1, 1, 2, 2]
Constraints
1 ≤ nums.length ≤ 300