Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 318 Bytes

File metadata and controls

3 lines (2 loc) · 318 Bytes

Idea behind the solution

You just need to apply the Bucket sort to sort any array of numbers in linear time. Since we know there will be only 1, 2 and 3, we will use a constant memory space just to count how many of each we found and then modify the array to be sorted.