Capgemini interview question

Code for sorting strings without using inbuilt swift functions