private static int solve ( String line ) {
  String wel = "welcome to code jam" ;
  int length = wel . length ( ) ;
  current = new int [ length ] ;
  int i , j ;
  for ( i = 0 ;
  i < line . length ( ) ;
  i ++ ) {
    char c = line . charAt ( i ) ;
    for ( j = 0 ;
    j < length ;
    j ++ ) {
      if ( c == wel . charAt ( j ) ) {
        if ( j > 0 ) {
          move ( j - 1 ) ;
        }
        else {
          inc ( j ) ;
        }
      }
    }
  }
  return current [ length - 1 ] ;
}

private static int solve ( String line ) { String wel = " welcome ▁ to ▁ code ▁ jam " ; int length = wel . length ( ) ; current = new int [ length ] ; int i , j ; for ( i = 0 ; i < line . length ( ) ; i ++ ) { char c = line . charAt ( i ) ; for ( j = 0 ; j < length ; j ++ ) { if ( c == wel . charAt ( j ) ) { if ( j > 0 ) { move ( j - 1 ) ; } else { inc ( j ) ; } } } } return current [ length - 1 ] ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))))) alternative: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier)))))))))))) (return_statement (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))