AdvancedRating 1800
Smallest Window
Print the shortest substring of s that contains every character of t (with multiplicity). If several, the leftmost. Print -1 if none.
Input
Two lines: s, then t.
Output
A substring or -1.
Sample 1
Input
ADOBECODEBANC ABC
Output
BANC
Sample 2
Input
a a
Output
a
Output appears here