Sorting | Simple solution with 100% beaten
IntuitionTo minimize the value of the partition ∣max(nums1) − min(nums2)∣, the key is to ensure that the difference between max(nums1) and min(nums2) is as smal
# Intuition
To minimize the value of the partition `∣max(nums1) − min(nums2)∣`, the key is to ensure that the difference between `max(nums1)` and `min(nums2)` is as small as possible. Sorting the array helps to achieve this because the closest pair of elements in the sorted array forms the boundary between the two partitions.

# Approach
- Sort the array
- Iterate Over Possible Partitions

# Complexity
- Time complexity: O(nlogn)

- Space complexity: O(n)

# Code
```cpp []
class Solution {
public:
    int findValueOfPartition(vector<int>& nums) {
        sort(nums.begin(), nums.end());
        int minimum = INT_MAX;
        for (int i = 1; i < nums.size(); i++){
            minimum = min(minimum, nums[i] - nums[i - 1]); 
        }
        return minimum;
    }
};
```
['C++']