← Amazon questions

Find max a[i] - a[j] with i > j

Filed under Amazon

Given an array of integers a, find the maximum value of a[i] - a[j] such that index i is strictly greater than index j. If no pair of indices (i, j) exists or if the array length is less than 2…

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.