Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 494 Bytes

File metadata and controls

18 lines (11 loc) · 494 Bytes

maxGap

Interview question of the issue #343 of rendezvous with cassidoo.

The Question

Given an integer array arr, return the maximum difference between two successive elements in arr's sorted form. Return 0 if there's 0 or 1 elements.

Example:

> maxGap([3,6,9,1,2])
> 3

Installing & Running

Just pnpm i to install all dependencies and then pnpm t to run the tests!