Problem 902 · Hard

Numbers At Most N Given Digit Set

Count shorter numbers by power, then walk the digits of n counting smaller choices at each position.

Open the interactive visualisation