Given a set of digits (A) in sorted order, find how many numbers of length B are possible whose value is less than number C.
Input:
0 1 5
1
2
Output:
2 (0 and 1 are possible)
Input:
0 1 2 5
2
21
Output:
5 (10, 11, 12, 15, 20 are possible)