Get the cyclic next integer number.
npm install cyclic-next






Get the cyclic next integer.
e.g.
Given maximum bound of 5
``text`
1
/ \
0 2
\ /
4-3 4
cyclic next of will be 0.
`sh`
npm install cyclic-next
`js
import cyclicNext from 'cyclic-next';
cyclicNext(5, 0) //=> 1
cyclicNext(5, 1) //=> 2
cyclicNext(5, 2) //=> 3
cyclicNext(5, 3) //=> 4
cyclicNext(5, 4) //=> 0
cyclicNext(5, 4, 1) //=> 0
cyclicNext(5, 4, 3) //=> 2
``
- MIT © Abhisek Pattnaik
Contributions are highly welcome! This repo is commitizen friendly — please read about it here.