Hello and welcome to the challenge!
Write a code that receives a positive integer number and returns the next smaller positive integer number formed from the same digits. Return
-1 if that's impossible.
solve(51) -> 15
solve(232) -> 223
solve(444) -> -1
- the given number
-1or the next smaller number made from the same digits
Have fun and good luck! :)