Given an array of digits (like ) and an integer , return the count of positive integers that can be formed using only those digits and are at most . For digits and , you can form: (one-digit), (two-digit), but nothing three-digit since .
Answer: . This is a clean introduction to digit DP. The only constraint is which digits you can use.