Daily Challenge (245 Part Series)
Apologies on missing yesterday's challenge. We have a fun one to hop in on today. If you haven't been following the series, feel free to give this one a try. If you're one of our more advanced users, consider this your rest day.
This challenge comes from user GiacomoSorbi on CodeWars
Your goal is to create a function that takes a positive integer and returns the next bigger number formed using the same digits.
A number like 2019 would not become 9210, as that is the largest possible number that can be created using those digits. The answer would be 2091, as that is the next larger number.
12 ==> 21
513 ==> 531
If a larger number cannot be composed using those digits, return -1 or
Good luck, happy coding!
Want to propose a challenge for a future post? Email firstname.lastname@example.org with your suggestions!