Samsung Electronics interview question

Next highest element for all the elements in the array