This function converts a number into its digit vector and uses above function to compute the answer
static int countInRange ( int x ) { num = new List < int > ( ) ; while ( x != 0 ) { num . Add ( x % 10 ) ; x /= 10 ; } num . Reverse ( ) ;