Print Longest Common Subsequence
Medium

Problem Statement

Given two strings, print their longest common subsequence. If there are multiple, any one is acceptable.

Examples

1Example 1
Input:
{ "s1": "AGGTAB", "s2": "GXTXAYB" }
Output:
"GTAB"
2Example 2
Input:
{ "s1": "ABCDGH", "s2": "AEDFHR" }
Output:
"ADH"
3Example 3
Input:
{ "s1": "acbcf", "s2": "abcdaf" }
Output:
"abcf"
Loading...

Sign in to Run Code and Submit