If i = 0 , any digit from [ 1 - 9 ] can be placed and also if N = 1 , then 0 can also be placed
if ( i == 0 ) : NEW_LINE INDENT if ( n == 1 ) : NEW_LINE INDENT digit = 0 NEW_LINE DEDENT else : NEW_LINE INDENT digit = 1 NEW_LINE DEDENT while digit <= 9 : NEW_LINE INDENT val += solve ( i + 1 , n , digit , sign ) NEW_LINE digit += 1 NEW_LINE DEDENT DEDENT