Get the next biggest number with the same digits using Python

The challenge Create a function that takes a positive integer and returns the next bigger number that can be formed by rearranging its digits. For example: If the digits can’t be rearranged to form a bigger number, return -1 (or nil in Swift): Test cases … Read more

Similar