Longest Common Subsequence of Three Strings
Given lowercase alphabet strings a
, b
, and c
, return the length of their longest common subsequence.
Constraints
0 ≤ n ≤ 100
wheren
is the length ofa
0 ≤ m ≤ 100
wherem
is the length ofb
0 ≤ k ≤ 100
wherek
is the length ofc
https://binarysearch.com/problems/Longest-Common-Subsequence-of-Three-Strings
Examples
Example 1
Input
- a =
epidemiologist
- b =
refrigeration
- c =
supercalifragilisticexpialodocious
Output
- answer =
5
Explanation
The longest common subsequence is “eieio”.
Leave a comment