abcde ace
For this input, the required output is 3.
3
abc abc
abc def
For this input, the required output is 0.
0
Given two strings sss and ttt, find the length of their longest common subsequence.
A subsequence is a sequence that can be derived by deleting some or no elements without changing the order of remaining elements.
length of LCS\text{length of LCS}length of LCS