Replaced the 2D array in LCS() with a vector< vector<int> >