Search
⌘K

Leetcode 3646. Next Special Palindrome Number

Find the smallest integer > n that is a palindrome and whose digit multiset satisfies "each digit k appears either 0 or exactly k times." The core challenge is to enumerate the limited subsets of digits (2^9 possibilities, with at most one odd-count to allow a palindrome) and construct the smallest palindrome from each candidate set to pick the minimal number greater than n.


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.