Hardest Coding question asked to me in the entire process.
Given an Array of digits 1-9, 0 excluding and a number N
Find how many numbers can be formed such that it is less than or equals to N. Digits can be repeated.
Eg: Arr - {1,4,9}
N - 10
Ans - 3 since (1, 4, 9)
Arr - {1,3,4,5}
N - 100
Ans - (1,3,4,5,11,13,14,15,33 ............. )