Given an array containing only 0, 1, and 2, sort it in-place so that all 0s come first, followed by 1s, and then 2s.

Example:

Input: [2,0,2,1,1,0]

Output: [0,0,1,1,2,2]

Enter fullscreen mode