Caterpillar interview question

Sorting a string with best runtime