leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

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 };