2740.cpp (268B)
1 class Solution { 2 public: 3 int findValueOfPartition(vector<int> &nums) { 4 sort(begin(nums), end(nums)); 5 int res = INT_MAX; 6 for (int i = 1; i < nums.size(); i++) 7 res = min(res, nums[i] - nums[i - 1]); 8 return res; 9 } 10 };