[Java] ✅ 18ms✅ beats 100% ✅ CLEAN CODE ✅ CLEAR EXPLANATIONS
Approach\n1. Looking at the requirement of max(nums1) - min(nums2) we realize that we need the max from nums1 to be as close as possible with min from nums2.\n2
# Approach\n1. Looking at the requirement of max(nums1) - min(nums2) we realize that we need the max from nums1 to be as close as possible with min from nums2.\n2. This is only possible if we SORT the numbers and we compare two at a time.\n3. Thus, when comparing numbers [a] and [a+1], it is guaranteed that [a] is max of num1 and [a+1] min of nums2.\n4. Sort them and compare each [i] with [i+1], returning their min difference.\n\n# Complexity\n- Time complexity:$$O(n * log(n))$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int findValueOfPartition(int[] nums) {\n        Arrays.sort(nums);\n        int partitionValue = Integer.MAX_VALUE;\n        for (int i = 1; i < nums.length && partitionValue != 0; i++) {\n            partitionValue = Math.min(partitionValue, nums[i] - nums[i-1]);\n        }\n        return partitionValue;\n    }\n}\n```
['Sorting', 'Java']