Agoda interview question

write sorting algorithm. create soldier team of 3 based on ranking