Find two numbers whose sum is N and does not contain any digit as K | Function to find two numbers whose sum is N and do not contain any digit as k ; Check every number i and ( n - i ) ; Check if i and n - i doesn 't  contain k in them print i and n-i ; check if flag is 0 then print - 1 ; Driver Code ; Given N and K ; Function Call
def findAandB ( n , k ) : NEW_LINE INDENT flag = 0 NEW_LINE for i in range ( 1 , n ) : NEW_LINE INDENT if str ( i ) . count ( chr ( k + 48 ) ) == 0 and str ( n - i ) . count ( chr ( k + 48 ) ) == 0 : NEW_LINE INDENT print ( i , n - i ) NEW_LINE flag = 1 NEW_LINE break NEW_LINE DEDENT DEDENT if ( flag == 0 ) : NEW_LINE INDENT print ( - 1 ) NEW_LINE DEDENT DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT N = 100 NEW_LINE K = 0 NEW_LINE findAandB ( N , K ) NEW_LINE DEDENT