Longest Common Subsequence Recursive
Medium

Problem Statement

Given two sequences, find the length of their longest subsequence present in both of them using a recursive approach.

Examples

1Example 1
Input:
{ "s1": "AGGTAB", "s2": "GXTXAYB" }
Output:
4
2Example 2
Input:
{ "s1": "ABCDGH", "s2": "AEDFHR" }
Output:
3
3Example 3
Input:
{ "s1": "ABC", "s2": "AC" }
Output:
2
Loading...

Sign in to Run Code and Submit