Given two non-negative integers N and P, return the number of base-10 numbers with N digits and with the digit product equal to P
Example:
Input: N = 3, P = 6
Output: 9
Explanation: [
123,
132,
213,
231,
312,
321,
116,
161,
611
]
Notes:N <= 12
Walkthroughs of the solution. Try the steps first, then watch to compare approaches.
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check