private static long sport ( int [ ] a , char [ ] chars ) {
  int n = a . length ;
  long [ ] pa = new long [ n + 1 ] ;
  long [ ] pb = new long [ n + 1 ] ;
  for ( int i = 1 ;
  i < n + 1 ;
  i ++ ) {
    if ( chars [ i - 1 ] == 'A' ) {
      pa [ i ] += pa [ i - 1 ] + a [ i - 1 ] ;
      pb [ i ] = pb [ i - 1 ] ;
    }
    else {
      pb [ i ] += pb [ i - 1 ] + a [ i - 1 ] ;
      pa [ i ] = pa [ i - 1 ] ;
    }
  }
  int from = Integer . MAX_VALUE ;
  int to = Integer . MAX_VALUE ;
  long max = 0 ;
  ;
}

private static long sport ( int [ ] a , char [ ] chars ) { int n = a . length ; long [ ] pa = new long [ n + 1 ] ; long [ ] pb = new long [ n + 1 ] ; for ( int i = 1 ; i < n + 1 ; i ++ ) { if ( chars [ i - 1 ] == ' A ' ) { pa [ i ] += pa [ i - 1 ] + a [ i - 1 ] ; pb [ i ] = pb [ i - 1 ] ; } else { pb [ i ] += pb [ i - 1 ] + a [ i - 1 ] ; pa [ i ] = pa [ i - 1 ] ; } } int from = Integer . MAX_VALUE ; int to = Integer . MAX_VALUE ; long max = 0 ; ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (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 (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (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: (identifier) 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: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) 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: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) 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: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)))))