🔥🔥 Easy || java || c++ ||
Java O(N)  Solution\n\nclass Solution {\n public static int findValueOfPartition(int[] nums) {\n        Arrays.sort(nums);\n        int ans=Integer.MAX_VALUE;\n
Java O(N)  Solution\n```\nclass Solution {\n public static int findValueOfPartition(int[] nums) {\n        Arrays.sort(nums);\n        int ans=Integer.MAX_VALUE;\n        for(int i=1;i<nums.length;i++){\n            ans=Math.min(ans,nums[i]-nums[i-1]);\n        }\n        return ans;\n    }\n}\n```\n\nC++ O(N) Solution\n```\nclass Solution {\npublic:\n    int findValueOfPartition(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int res=INT_MAX;\n        for(int i=1;i<nums.size();i++){\n            res=min(res,nums[i]-nums[i-1]);\n        }\n        return res;\n    }\n};\n```
['C', 'Sorting', 'Java']