Longest Repeating Subsequence
Medium

Problem Statement

Find the length of the longest subsequence that appears at least twice in the given string, where the two occurrences have different indices.

Examples

1Example 1
Input:
{ "s": "AABEBCDD" }
Output:
3
2Example 2
Input:
{ "s": "aab" }
Output:
1
3Example 3
Input:
{ "s": "axxxy" }
Output:
2
Loading...

Sign in to Run Code and Submit