static boolean checkValidPair ( int num1 , int num2 ) {
  String s1 = Integer . toString ( num1 ) ;
  String s2 = Integer . toString ( num2 ) ;
  for ( int i = 0 ;
  i < s1 . length ( ) ;
  i ++ ) for ( int j = 0 ;
  j < s2 . length ( ) ;
  j ++ ) if ( s1 . charAt ( i ) == s2 . charAt ( j ) ) return true ;
  return false ;
}

static boolean checkValidPair ( int num1 , int num2 ) { String s1 = Integer . toString ( num1 ) ; String s2 = Integer . toString ( num2 ) ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) for ( int j = 0 ; j < s2 . length ( ) ; j ++ ) if ( s1 . charAt ( i ) == s2 . charAt ( j ) ) return true ; return false ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (return_statement (true))))) (return_statement (false))))