static String maximumProduct ( String str , int n ) {
  String answer = "" , curr = "" ;
  long maxProduct = 0 , product = 1 ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    product *= 1L * value ( str . charAt ( i ) ) ;
    curr += str . charAt ( i ) ;
    if ( product >= maxProduct ) {
      maxProduct = product ;
      answer = curr ;
    }
    if ( product == 0 ) {
      product = 1 ;
      curr = "" ;
    }
  }
  return answer ;
}

static String maximumProduct ( String str , int n ) { String answer = " " , curr = " " ; long maxProduct = 0 , product = 1 ; for ( int i = 0 ; i < n ; i ++ ) { product *= 1L * value ( str . charAt ( i ) ) ; curr += str . charAt ( i ) ; if ( product >= maxProduct ) { maxProduct = product ; answer = curr ; } if ( product == 0 ) { product = 1 ; curr = " " ; } } return answer ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal)) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (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: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (string_literal))))))) (return_statement (identifier))))