```
class Solution(object):
def maximumGap(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
nums.sort()
l = len(nums)
if l < 2:
return 0
m = 0
for i in range(l-1):
m = max(m,abs(nums[i]-nums[i+1]))
return m
```

Sort the array, check two neighbors and keep track of the best difference