c++ longest common subsequence