Sort by distribution.

It is an algorithm for time efficiency at the cost of space efficiency,
the inputs must be continuous and consecutive, and it sorts the given
array.