Search
⌘K

Leetcode 1842. Next Palindrome Using Same Digits

Given a number, rearrange its digits to form the smallest palindrome strictly greater than the original using exactly the same digits (or report impossible). The core challenge is to build a valid palindromic half from digit counts and find the next lexicographic arrangement (including handling the middle digit for odd lengths and parity constraints) that yields a larger number.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.