static int lcs ( String X , String Y , int m , int n ) {
  if ( m == 0 || n == 0 ) {
    return 0 ;
  }
  if ( X . charAt ( m - 1 ) == Y . charAt ( n - 1 ) ) {
    return 1 + lcs ( X , Y , m - 1 , n - 1 ) ;
  }
  else {
    return Math . max ( lcs ( X , Y , m , n - 1 ) , lcs ( X , Y , m - 1 , n ) ) ;
  }
}

static int lcs ( String X , String Y , int m , int n ) { if ( m == 0 || n == 0 ) { return 0 ; } if ( X . charAt ( m - 1 ) == Y . charAt ( n - 1 ) ) { return 1 + lcs ( X , Y , m - 1 , n - 1 ) ; } else { return Math . max ( lcs ( X , Y , m , n - 1 ) , lcs ( X , Y , m - 1 , n ) ) ; } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (return_statement (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))))) consequence: (block (return_statement (binary_expression left: (decimal_integer_literal) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal))))))) alternative: (block (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))))))))))