Find the maximum gap between consecutive elements of the sorted array.
Unlock detailed company stats for this questionUpgrade
Given an array of integers, find the maximum difference between two consecutive elements after sorting the array.
Example: input 3 6 9 1 sorts to 1 3 6 9, with gaps 2, 3, 3, so the output is 3.
Community answers
No answers contributed by the community yet.
Related questions
Find the maximum element in a rotated sorted array.Find the second maximum element in an array.Find the minimum element in a rotated sorted array.Related courses

Course

Course
Course
