https://leetcode.com/problems/maximum-gap


Success.

___

Runtime
1104 ms

Beats
85.84%

Memory
28.2 MB

Beats
46.29%

___

```python
import math

class Solution:
    def maximumGap(self, nums: List[int]) -> int:
        #2022/12/29 06:52
        self.maximum_value = -math.inf
        nums.sort()
        for index, num in enumerate(nums):
            if index != len(nums) - 1:
                next_num = nums[index+1]
                difference = next_num - num
                if difference > self.maximum_value:
                    self.maximum_value = difference
        if self.maximum_value == -math.inf:
            return 0
        return self.maximum_value
        #2022/12/29 06:54
```
