Find the next greater permutation of a number, using the exact same set of digits. If no such permutation exists, return the permutation with the smallest value (sorted ascending).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.