Sponsored
Use these hints if you're stuck. Try solving on your own first.
Try sorting nums.
If nums is consecutive and sorted in ascending order, then nums[i] + 1 = nums[i + 1] for every i in the range 0 ≤ i < nums.length - 1.
Solve with full IDE support and test cases