FunctionRacerProblemsRace

Largest Gap

EasyNumPyPython

Imagine the numbers in nums sorted from smallest to largest. Return the largest difference between two neighbors in that sorted order. If there is only one number, return 0.

Example 1

nums [10,1,4,20]
returns 10

Sorted: 1, 4, 10, 20. The gaps are 3, 6 and 10.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems