Samsung Electronics Interview Question

Next highest element for all the elements in the array