Pergunta de entrevista da empresa Traveloka

First max element to the right of every element in the array.