static void printCommon ( String s1 , String s2 ) {
  int [ ] a1 = new int [ MAX_CHAR ] ;
  int [ ] a2 = new int [ MAX_CHAR ] ;
  int length1 = s1 . length ( ) ;
  int length2 = s2 . length ( ) ;
  for ( int i = 0 ;
  i < length1 ;
  i ++ ) a1 [ s1 . charAt ( i ) - 'a' ] += 1 ;
  for ( int i = 0 ;
  i < length2 ;
  i ++ ) a2 [ s2 . charAt ( i ) - 'a' ] += 1 ;
  for ( int i = 0 ;
  i < MAX_CHAR ;
  i ++ ) {
    if ( a1 [ i ] != 0 && a2 [ i ] != 0 ) {
      for ( int j = 0 ;
      j < Math . min ( a1 [ i ] , a2 [ i ] ) ;
      j ++ ) System . out . print ( ( ( char ) ( i + 'a' ) ) ) ;
    }
  }
}

static void printCommon ( String s1 , String s2 ) { int [ ] a1 = new int [ MAX_CHAR ] ; int [ ] a2 = new int [ MAX_CHAR ] ; int length1 = s1 . length ( ) ; int length2 = s2 . length ( ) ; for ( int i = 0 ; i < length1 ; i ++ ) a1 [ s1 . charAt ( i ) - ' a ' ] += 1 ; for ( int i = 0 ; i < length2 ; i ++ ) a2 [ s2 . charAt ( i ) - ' a ' ] += 1 ; for ( int i = 0 ; i < MAX_CHAR ; i ++ ) { if ( a1 [ i ] != 0 && a2 [ i ] != 0 ) { for ( int j = 0 ; j < Math . min ( a1 [ i ] , a2 [ i ] ) ; j ++ ) System . out . print ( ( ( char ) ( i + ' a ' ) ) ) ; } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) right: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) right: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) consequence: (block (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 (array_access array: (identifier) index: (identifier)) (array_access array: (identifier) index: (identifier))))) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (parenthesized_expression (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal)))))))))))))))