Outreach interview question

some sorting question based on a array