Given an unsorted array (all elements are non-negative integers), find the maximum difference between consecutive elements in its sorted form.
How can I solve the problem without sorting the array? Sorting seems like overkill. Maybe there is a solution O (n)?
source
share