static void printDistinct ( String str ) {
  int n = str . length ( ) ;
  int [ ] count = new int [ MAX_CHAR ] ;
  int [ ] index = new int [ MAX_CHAR ] ;
  for ( int i = 0 ;
  i < MAX_CHAR ;
  i ++ ) {
    count [ i ] = 0 ;
    index [ i ] = n ;
  }
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    char x = str . charAt ( i ) ;
    ++ count [ x ] ;
    if ( count [ x ] == 1 && x != ' ' ) index [ x ] = i ;
    if ( count [ x ] == 2 ) index [ x ] = n ;
  }
  Arrays . sort ( index ) ;
  for ( int i = 0 ;
  i < MAX_CHAR && index [ i ] != n ;
  i ++ ) System . out . print ( str . charAt ( index [ i ] ) ) ;
}

static void printDistinct ( String str ) { int n = str . length ( ) ; int [ ] count = new int [ MAX_CHAR ] ; int [ ] index = new int [ MAX_CHAR ] ; for ( int i = 0 ; i < MAX_CHAR ; i ++ ) { count [ i ] = 0 ; index [ i ] = n ; } for ( int i = 0 ; i < n ; i ++ ) { char x = str . charAt ( i ) ; ++ count [ x ] ; if ( count [ x ] == 1 && x != ' ▁ ' ) index [ x ] = i ; if ( count [ x ] == 2 ) index [ x ] = n ; } Arrays . sort ( index ) ; for ( int i = 0 ; i < MAX_CHAR && index [ i ] != n ; i ++ ) System . out . print ( str . charAt ( index [ i ] ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (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: (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))))) (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (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: (identifier) right: (character_literal)))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))))) (expression_statement (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: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))))))))