🔥 Go/Python One Line Solution | Beat 97% | With Explanation 🔥
Approach\n Describe your approach to solving the problem. \nSort nums first and the minimum difference between two neighboured element is the answer.\n\n# Compl
# Approach\n<!-- Describe your approach to solving the problem. -->\nSort `nums` first and the minimum difference between two neighboured element is the answer.\n\n# Complexity\n- Time complexity: $$O(n\\text{log}n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```Python []\nclass Solution:\n    def findValueOfPartition(self, nums: List[int]) -> int:\n        return min(y - x for x, y in pairwise(sorted(nums)))\n```\n```Go []\nfunc findValueOfPartition(nums []int) int {\n\tsort.Ints(nums)\n\tans := nums[1] - nums[0]\n\tfor i := 2; i < len(nums); i++ {\n\t\tans = min(ans, nums[i]-nums[i-1])\n\t}\n\treturn ans\n}\n```
['Sorting', 'Go', 'Python3']