for checking whether digit to be placed is up to upper bound at the position pos or upto 9
if ( f == 0 ) lmt = v . get ( pos ) ; int ans = 0 ; for ( int digit = 0 ; digit <= lmt ; digit ++ ) { int nf = f ;