[JAVA] easy solution explained
Intuition\n Describe your first thoughts on how to solve this problem. \nThe solution must be the  minimum difference between two adjacent elements after sortin
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe solution must be the  minimum difference between two adjacent elements after sorting the array `nums`\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nAfter sorting the array `nums` check for the minimum difference between adjacent elements and return the minimum difference\n\n# Complexity\n- Time complexity: O(nlogn) *for sorting*\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(logn) *used by sorting algorithm*\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int findValueOfPartition(int[] nums) {\n     Arrays.sort(nums);\n     int res = nums[1] - nums[0];\n     for(int i = 2; i < nums.length; i ++) \n         res = Math.min(res, nums[i] - nums[i - 1]);\n     return res;  \n    }\n}\n```\n# PLEASE UPVOTE IF IT WAS HELPFULL
['Array', 'Sorting', 'Java']