Given a number represented as a string or integer, rearrange its digits to find the next lexicographically greater permutation. If such arrangement is not possible, return the smallest possible…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.