public static int getDistinctPoints ( int current_pos , String path ) {
  int len = path . length ( ) ;
  int points [ ] = new int [ len + 1 ] ;
  points [ 0 ] = current_pos ;
  for ( int i = 0 ;
  i < len ;
  i ++ ) {
    char ch = path . charAt ( i ) ;
    if ( ch == '0' ) {
      current_pos -- ;
      points [ i + 1 ] = current_pos ;
    }
    else {
      current_pos ++ ;
      points [ i + 1 ] = current_pos ;
    }
  }
  return countDistinct ( points , len + 1 ) ;
}

public static int getDistinctPoints ( int current_pos , String path ) { int len = path . length ( ) ; int points [ ] = new int [ len + 1 ] ; points [ 0 ] = current_pos ; for ( int i = 0 ; i < len ; i ++ ) { char ch = path . charAt ( i ) ; if ( ch == '0' ) { current_pos -- ; points [ i + 1 ] = current_pos ; } else { current_pos ++ ; points [ i + 1 ] = current_pos ; } } return countDistinct ( points , len + 1 ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (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: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) 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))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier)))) alternative: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier))))))) (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))))))