A subsequence is a sequence derived from an another original sequence by deleting some elements while leaving the order unchanged.
Given 2 strings, find the length of the longest common subsequence between them. There will be no spaces in the strings and it would be less than 1000 characters long.
2 strings, one on each line
A single integer indicating the length of the longest common subsequence.
happy apple
3 [app is common]
Ranald Iran
2 [an is common, R and r are not considered the same]
Subtask | Score |
---|---|
1 | 100 |
2 | 0 |