AppDirect interview question

sorting array question