Skip to content

Latest commit

 

History

History

324-lexoNext

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

lexoNext

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

The Question

Given a number, rearrange its digits to make it the next larger number. So not the maximum size it can be, but the lexicographically next greater permutation of numbers!

Example:

> lexoNext(123)
> 132

> lexoNext(314159)
> 314195

Installing & Running

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