← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given two strings X and Y, find the longest subsequence of X that is also a contiguous substring of Y. In other words, you must select characters from X in their original order (they do not have to be contiguous in X) so that the resulting string appears as a contiguous block somewhere inside Y. Return that longest possible string. If several answers have the same maximum length, returning any one of them is acceptable.