Available question text
Count how many positive integers you can form (with unlimited repeats from a given set of allowed digits) that are <= n.
This is solved with combinatorics/digit-DP: sum all possibilities with fewer digits and then process n's digits left-to-right, counting allowed choices smaller at each position and stopping if a digit of n isn't available.
Related questions
Continue with questions that share topics or the same question type.
- Count Non Decreasing Arrays With Given Digit Sums
Coding · Array · Dynamic Programming · Prefix Sum
- Find Median Given Frequency of Numbers
Coding
- Finding 3-Digit Even Numbers
Coding
- Generate String to Maximize Unique Two-Digit Numbers Score
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 902. Numbers At Most N Given Digit Set
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source