โ† Amazon questions

Find nearest greater element on the right for each array element

Filed under Amazon

Given an array of integers, construct an output array where each position contains the first element to its right that is greater than itself, or -1 if none exists.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.