Closed
Description
Given an array of 0s, 1s, 2s, could you come up with a linear and in place algorithm to sort the array in ascending order.
You're not allowed to use counting sort.
E.g.
- Input: [1, 0, 2, 1, 0]
- Output: [0 0 1 1 2]
For more details