LearnPy Hub
← Arena
AdvancedRating 1800

Shortest Window Containing a Subsequence

Find the shortest substring of s that contains t as a subsequence. Print it (the leftmost one if there are several of equal length), or NONE.

Input

s, then t.

Output

One string or NONE.

Sample 1

Input
abcdebdde
bde
Output
bcde

Sample 2

Input
jmeqksfrsdcmsiwvaovztaqenprpvnbstl
u
Output
NONE
solution.py
Output appears here
Shortest Window Containing a Subsequence · Python Arena problem · LearnPy Hub