Knab Interview Question

String rearrangement problem without using any built-in sorting functions