static int maxLen ( String s , int n ) {
  if ( allones ( s , n ) ) return - 1 ;
  int arr [ ] = new int [ MAX ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) arr [ i ] = ( s . charAt ( i ) == '0' ? 1 : - 1 ) ;
  int dp [ ] [ ] = new int [ MAX ] [ 3 ] ;
  for ( int [ ] row : dp ) Arrays . fill ( row , - 1 ) ;
  return findlength ( arr , s , n , 0 , 0 , dp ) ;
}

static int maxLen ( String s , int n ) { if ( allones ( s , n ) ) return - 1 ; int arr [ ] = new int [ MAX ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = ( s . charAt ( i ) == '0' ? 1 : - 1 ) ; int dp [ ] [ ] = new int [ MAX ] [ 3 ] ; for ( int [ ] row : dp ) Arrays . fill ( row , - 1 ) ; return findlength ( arr , s , n , 0 , 0 , dp ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (parenthesized_expression (ternary_expression condition: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)) consequence: (decimal_integer_literal) alternative: (unary_expression operand: (decimal_integer_literal))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) dimensions: (dimensions_expr (decimal_integer_literal))))) (enhanced_for_statement type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) value: (identifier) body: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (unary_expression operand: (decimal_integer_literal)))))) (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (decimal_integer_literal) (decimal_integer_literal) (identifier))))))