Given a positive integer N, find the smallest integer greater than N that can be formed by rearranging the digits of N. If no such integer exists (i.e., the digits are in non-increasing order), return…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.