
Given an array of digits which is sorted in non-decreasing order. You can write numbers using each digits[i] as many times as we want. For example, if digits = ['1','3','5'] , we may write numbers such as '13' , '551' , and '1351315' .
Return the number of positive integers that can be generated that are less than or equal to a given integer n .
1 <= digits.length <= 9digits[i].length == 1digits[i] is a digit from '1' to '9' .All the values in digits are unique .digits is sorted in non-decreasing order.1 <= n <= 10 ^9