164. Maximum Gap
problem description
Input: [3,6,9,1]
Output: 3
Explanation: The sorted form of the array is [1,3,6,9], either
(3,6) or (6,9) has the maximum difference 3.Input: [10]
Output: 0
Explanation: The array contains less than 2 elements, therefore return 0.algorithm thought
code
algorithm analysis
Last updated