In the following input::
I did not understand why the expected is 3. Because, the maximum gap in sorted form is 9 -3 = 6. May be my understanding is wrong. Can anybody please explain the problem with example?
Sorted, the array is [1,3,6,9]. There's no gap from 3 to 9 because there's the 6 between them. And if you ignore that, why don't you also ignore the 3 and think the biggest gap is 9-1=8?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.