Smallest Window In A String Containing All The Characters Of Another String

easy
1. Given a string S and text R. Output the smallest window in the string S having all characters of the text R. 2. Both the string S and text R contains lowercase english alphabets.

Input Format

Each test contains 2 lines having a string S and next line contains text R.

Output Format

N/A

Constraints

1 <= |S|, |R| <= 1000

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
timetopractice
toc
Output
toprac
Previous
Smallest Subarray With All-occurrences-of-a-most-frequent-element
Next
Sort Characters By Frequency

Related Questions