Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 616 Bytes

File metadata and controls

24 lines (15 loc) · 616 Bytes

betweenNums

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

The Question

There is a sorted integer array that has been rotated an unknown number of times. Given that rotated array, return how many times it has been rotated. It may contain duplicate numbers!

Example:

> rotatedNum([4, 0, 1, 2, 3])
> 1

> rotatedNum([7, 9, 20])
> 0

> rotatedNum([7, 7, 314, 1337, 7])
> 4

Installing & Running

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