Search
⌘K

Leetcode 2048. Next Greater Numerically Balanced Number

Find the smallest integer > n such that for every digit d in the number, digit d appears exactly d times. The core challenge is generating/validating the constrained set of possible digit-count combinations (which is small due to the digit-count rules and n ≤ 10^6) and selecting the minimal candidate 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.