Two friends each encode the play order of one of their playlists as a string, where each character is a single-letter code for a track. Find the length of the longest sequence of track codes that appears, in the same relative order, in both playlists (the tracks do not need to be consecutive in either playlist).
Input format
Line 1: the first playlist s1 (may be empty, producing a blank line).
Line 2: the second playlist s2 (may be empty, producing a blank line).
Both strings contain only lowercase English letters.
Output format
A single integer: the length of the longest common subsequence of s1 and s2.
Constraints
- 0 <= |s1|, |s2| <= 40