Hey man, it is
C++
!
#include <iostream>
#include <string>
int lcs( const std::string & X, const std::string & Y, size_t m, size_t n )
{
if (m == 0 || n == 0)
return 0;
if (X[m-1] == Y[n-1])
return 1 + lcs(X, Y, m-1, n-1);
else
return std::max(lcs(X, Y, m, n-1), lcs(X, Y, m-1, n));
}
int main()
{
std::string X,Y;
getline(std::cin, X);
getline(std::cin, Y);
std::cout << "Length of LCS is " << lcs(X,Y, X.size(), Y.size()) << std::endl;
}