Else set the value of count for this new digit accordingly from max_digit [ ]
ans = ( ans + ( findCountUtil ( N , maxDigit , position + 1 , i , count - 1 if ( previous == i and position != 0 ) else maxDigit [ i ] - 1 ) ) % 1000000007 ) % 1000000007 NEW_LINE dp [ position ] [ previous ] [ count ] = ans NEW_LINE return ans NEW_LINE