Anonymous interview question

Find the next greatest element in array