← Amazon questions
CodingReported in a candidate post, Mar 2021

Maximum gap in O(n) time

Filed under Amazon

Given an unsorted array of integers nums, return the maximum difference between two successive elements in its sorted form (the maximum gap). If the array has fewer than 2 elements, return 0. Solve it…

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.