0164. Maximum Gap
https://leetcode.com/problems/maximum-gap
Description
Given an integer array nums
, return the maximum difference between two successive elements in its sorted form. If the array contains less than two elements, return 0
.
You must write an algorithm that runs in linear time and uses linear extra space.
Example 1:
Example 2:
Constraints:
1 <= nums.length <= 105
0 <= nums[i] <= 109
ac
Last updated