C++ Sorting ; Beats 99% of other submissions.
Intuition\nSorting the array will provide us with the absolute difference between every adjacent elements, this will in turn make it clear as to where the inter
# Intuition\nSorting the array will provide us with the absolute difference between every adjacent elements, this will in turn make it clear as to where the intersection point should.\n\n# Approach\nSorted the array in a non-decreasing order. The result variable keeps track of the minimum absolute difference between every adjacent elements.\n\n# Complexity\n- Time complexity:\nO(N LogN)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int findValueOfPartition(vector<int>& nums) {\n        std::ios::sync_with_stdio(false);\n        cin.tie(NULL);\n\n        sort(nums.begin(), nums.end());\n\n        int n = nums.size();\n        int result = INT_MAX;\n\n        for (int i = 1; i < n; i++) {\n            result = min(result, nums[i] - nums[i-1]);\n        }\n\n        return result;\n    }\n};\n```
['Sorting', 'C++']