static String get_maximum ( char [ ] s , int a [ ] ) {
  int n = s . length ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( s [ i ] - '0' < a [ s [ i ] - '0' ] ) {
      int j = i ;
      while ( j < n && ( s [ j ] - '0' <= a [ s [ j ] - '0' ] ) ) {
        s [ j ] = ( char ) ( '0' + a [ s [ j ] - '0' ] ) ;
        j ++ ;
      }
      return String . valueOf ( s ) ;
    }
  }
  return String . valueOf ( s ) ;
}

static String get_maximum ( char [ ] s , int a [ ] ) { int n = s . length ; for ( int i = 0 ; i < n ; i ++ ) { if ( s [ i ] - '0' < a [ s [ i ] - '0' ] ) { int j = i ; while ( j < n && ( s [ j ] - '0' <= a [ s [ j ] - '0' ] ) ) { s [ j ] = ( char ) ( '0' + a [ s [ j ] - '0' ] ) ; j ++ ; } return String . valueOf ( s ) ; } } return String . valueOf ( s ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (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: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)) right: (array_access array: (identifier) index: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)) right: (array_access array: (identifier) index: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))))))) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (character_literal) right: (array_access array: (identifier) index: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)))))))) (expression_statement (update_expression (identifier))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))