it's said "Given an unsorted array, find the maximum difference between the successive elements in its sorted form."
What does it mean by "difference"? What is the difference between the successive elements? What does "in its sorted form" mean?
"difference" between two elements A and B means the absolute value of (A - B).
"in its sorted form" means we need to get the maximum gap in the global sorted order, not the the given unsorted array order.
For example, given a array [1, 7, 3, 3], the expected result it 4, not (7 - 1) = 6.
We need to sort the the array into [1, 3, 3, 7], and get the maximum gap between the successive elements in this sorted array, which is (7 - 3) = 4.