For other digits , any digit from 0 to abs ( prev1 - prev2 ) can be placed
else { for ( int j = 0 ; j <= abs ( prev1 - prev2 ) ; ++ j ) { dp [ digit ] [ prev1 ] [ prev2 ] += countOfNumbers ( digit + 1 , j , prev1 , N ) ; } }