LinkedIn Interview Question

Array question for coding which has some sorting in it. Do not quite remember but it was average in terms of difficulty