private static int maxCandies ( int [ ] [ ] candies ) {
  int topSum = 0 ;
  int bottomDelta = 0 ;
  int i = 0 ;
  for ( ;
  i < candies [ 0 ] . length - 1 ;
  i ++ ) {
    bottomDelta += candies [ 1 ] [ i ] - candies [ 0 ] [ i + 1 ] ;
    if ( bottomDelta < 0 ) bottomDelta = 0 ;
    topSum += candies [ 0 ] [ i ] ;
  }
  topSum += candies [ 0 ] [ i ] + candies [ 1 ] [ i ] ;
  return topSum + bottomDelta ;
}

private static int maxCandies ( int [ ] [ ] candies ) { int topSum = 0 ; int bottomDelta = 0 ; int i = 0 ; for ( ; i < candies [ 0 ] . length - 1 ; i ++ ) { bottomDelta += candies [ 1 ] [ i ] - candies [ 0 ] [ i + 1 ] ; if ( bottomDelta < 0 ) bottomDelta = 0 ; topSum += candies [ 0 ] [ i ] ; } topSum += candies [ 0 ] [ i ] + candies [ 1 ] [ i ] ; return topSum + bottomDelta ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (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: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement condition: (binary_expression left: (identifier) right: (binary_expression left: (field_access object: (array_access array: (identifier) index: (decimal_integer_literal)) field: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (identifier))))) (return_statement (binary_expression left: (identifier) right: (identifier)))))