164. Maximum Gap — Explanation
Given an integer arraynums
, return the maximum difference between two successive elements in its sorted form. If the array contains less than two elements, return0
.
You must write an algorithm that runs in linear time and uses linear extra space.