Longest repeated subsequence