Meddo Health interview question

sort the array make rest api