static String removeDupsSorted ( String str ) {
  int res_ind = 1 , ip_ind = 1 ;
  char arr [ ] = str . toCharArray ( ) ;
  while ( ip_ind != arr . length ) {
    if ( arr [ ip_ind ] != arr [ ip_ind - 1 ] ) {
      arr [ res_ind ] = arr [ ip_ind ] ;
      res_ind ++ ;
    }
    ip_ind ++ ;
  }
  str = new String ( arr ) ;
  return str . substring ( 0 , res_ind ) ;
}

static String removeDupsSorted ( String str ) { int res_ind = 1 , ip_ind = 1 ; char arr [ ] = str . toCharArray ( ) ; while ( ip_ind != arr . length ) { if ( arr [ ip_ind ] != arr [ ip_ind - 1 ] ) { arr [ res_ind ] = arr [ ip_ind ] ; res_ind ++ ; } ip_ind ++ ; } str = new String ( arr ) ; return str . substring ( 0 , res_ind ) ; }
(method_declaration (modifiers) type: (type_identifier) 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: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))))) (expression_statement (update_expression (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))))))