Largest subsequence problem