Crédit Agricole interview question

Write a function to do sorting