RubrikOA #6
Longest Subsequence Matching a Substring
估计中等可在线判题
Given strings x and y, find the maximum length of a subsequence of x that is also a non-empty contiguous substring of y.
输入格式
Two lines with non-empty ASCII strings x and y; added by this site: |x|,|y|≤2000.
输出格式
Output the required length; if no non-empty match exists, output 0.
样例 1
输入:
abcd
abdc
输出:
3
样例 2
输入:
hackerranks
hackers
输出:
7
样例 3
输入:
abc
XYZ
输出:
0