Easy 4 Line C++ Code
\n\n\n# Approach\nFirst sort the array in accending order and then take the minimum of adjecent elements\n\nThe mininum is the answer\n\n# Complexity\n- Time co
\n\n\n# Approach\nFirst sort the array in accending order and then take the minimum of adjecent elements\n\nThe mininum is the answer\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n- $$O(nlog(n))$$\n\n- Space complexity:\n- As we are not using any additional space therefore $$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n    int findValueOfPartition(vector<int>& nums) {\n        sort(nums.begin(), nums.end());\n        int mn = INT_MAX; \n        for(int i = 0; i < nums.size()-1; i++)\n        {\n            mn = min(mn, nums[i+1] - nums[i]);\n        }\n        return mn;\n    }\n};\n```
['C++']