AlgoUniversity
  • Go Back
Discussion
Window String :

Author

Akshay Sharma

Difficulty Level : Medium

Submissions : 317

Asked In : Amazon

Marks :100

: 4 | : 0

Given two strings 's' and 't' containing characters from a to z of lengths 'm' and 'n' respectively, return the minimum window substring of 's' such that every character in 't' (including duplicates) is included in the window. If there is no such substring, return the empty string ""'.

Input

The first line of input contains string s ($$$1 \le S \le 1e4$$$). Second line contains a string t ($$$1 \le t \le 1e4 $$$)

Output

For each output print the substring of the minimum window.

Example

Input
adovecodebanc
abc
Output
banc

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.