static char encodedChar ( char [ ] str , int k ) {
  int i , j ;
  int n = str . length ;
  int len ;
  int num ;
  int freq ;
  i = 0 ;
  while ( i < n ) {
    j = i ;
    len = 0 ;
    freq = 0 ;
    while ( j < n && Character . isAlphabetic ( str [ j ] ) ) {
      j ++ ;
      len ++ ;
    }
    while ( j < n && Character . isDigit ( str [ j ] ) ) {
      freq = freq * 10 + ( str [ j ] - '0' ) ;
      j ++ ;
    }
    num = freq * len ;
    if ( k > num ) {
      k -= num ;
      i = j ;
    }
    else {
      k -- ;
      k %= len ;
      return str [ i + k ] ;
    }
  }
  return str [ k - 1 ] ;
}

static char encodedChar ( char [ ] str , int k ) { int i , j ; int n = str . length ; int len ; int num ; int freq ; i = 0 ; while ( i < n ) { j = i ; len = 0 ; freq = 0 ; while ( j < n && Character . isAlphabetic ( str [ j ] ) ) { j ++ ; len ++ ; } while ( j < n && Character . isDigit ( str [ j ] ) ) { freq = freq * 10 + ( str [ j ] - '0' ) ; j ++ ; } num = freq * len ; if ( k > num ) { k -= num ; i = j ; } else { k -- ; k %= len ; return str [ i + k ] ; } } return str [ k - 1 ] ; }
(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: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (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))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))))) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)))))) (expression_statement (update_expression (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (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)))) alternative: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (return_statement (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier)))))))) (return_statement (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))