Python3 O(NlogN) Solution with sorting (100.00% Runtime)
IntuitionApproach
Get two elements of minimum differences by sorting.
Once you get those two elements, you can always form partitions based on those two numbers
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
![image.png](https://assets.leetcode.com/users/images/192f16e2-2940-46f8-a61b-4694b9279af7_1737385870.0794377.png)

# Approach
<!-- Describe your approach to solving the problem. -->
- Get two elements of minimum differences by sorting.
- Once you get those two elements, you can always form partitions based on those two numbers.

# Complexity
- Time complexity: O(NlogN)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
If this solution is similar to yours or helpful, upvote me if you don't mind
```python3 []
class Solution:
    def findValueOfPartition(self, nums: List[int]) -> int:
        nums.sort()
        mn=2*10**9
        p=nums[0]
        for n in nums[1:]:
            d=n-p
            if d<mn:
                mn=d
            p=n
        return mn
```
['Array', 'Math', 'Greedy', 'Brainteaser', 'Sorting', 'Python', 'Python3']