title
You have to create a function that takes a positive integer number and returns the next bigger number formed by the same digits:1
2
3nextBigger(12)==21
nextBigger(513)==531
nextBigger(2017)==2071
If no bigger number can be composed using those digits, return -1:
1 | nextBigger(9)==-1 |
good soulutions
1 | //one |