Interview question of the issue #324 of rendezvous with cassidoo.
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
Just pnpm i
to install all dependencies and then pnpm t
to run the tests!