Given two sequences of characters, determine the length of the longest contiguous or non-contiguous substring common to both.
Explanation: The longest common subsequence is 'efgh' with a length of 4.
Explanation: The longest common subsequence is 'mn' with a length of 2.
Explanation: There are no common characters between the two strings.
Longest shared subsequence of two strings
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak