Skip to content

Latest commit

 

History

History

343-maxGap

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

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!