Implement `CountingSort`