private static int [ ] prep ( String s ) {
  int [ ] sPre = new int [ s . length ( ) + 1 ] ;
  for ( int i = 1 ;
  i <= s . length ( ) ;
  i ++ ) {
    char c = s . charAt ( i - 1 ) ;
    if ( c == 'A' ) {
      sPre [ i ] = sPre [ i - 1 ] + 1 ;
    }
    else {
      sPre [ i ] = sPre [ i - 1 ] + 2 ;
    }
  }
  return sPre ;
}

private static int [ ] prep ( String s ) { int [ ] sPre = new int [ s . length ( ) + 1 ] ; for ( int i = 1 ; i <= s . length ( ) ; i ++ ) { char c = s . charAt ( i - 1 ) ; if ( c == ' A ' ) { sPre [ i ] = sPre [ i - 1 ] + 1 ; } else { sPre [ i ] = sPre [ i - 1 ] + 2 ; } } return sPre ; }
(method_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) parameters: (formal_parameters (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 (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) 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 (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))))))) (return_statement (identifier))))