C++ | Adjacent Minimum
Complexity\n- Time complexity: O(nlog(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
# Complexity\n- Time complexity: O(nlog(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 {\npublic:\n    int findValueOfPartition(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        const int n = nums.size();\n        int ans = INT_MAX;\n        for(int i=1;i<n;++i){\n            ans = min(ans,abs(nums[i]-nums[i-1]));\n        }\n        return ans;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'C++']