Loading...
Given an array with n objects colored red (0), white (1), or blue (2), sort them in-place so same colors are adjacent in order 0, 1, 2.
Output space-separated.
2,0,2,1,1,0
0 0 1 1 2 2
2, 0, 2, 1, 1, 0, which needs to be sorted in-place with same colors adjacent in order 0, 1, 2.0, 0, 1, 1, 2, 2, which is then output as space-separated values: 0 0 1 1 2 2.