LCS problem