Adobe Interview Question

Next greatest number in array for each index