Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sort the array.
The answer is min(nums[i+1] - nums[i]) for all i in the range [0, n-2].
Solve with full IDE support and test cases