Given two strings s1 and s2. Find the smallest window in the string s1 consisting of all the characters(including duplicates) of the string s2. return empty string in case no such window is present.
If there are multiple such windows of the same length, return the one with the least starting index.
Note: All characters are in lowercase letters.
Topics
Companies
Articles
Examples:
NA
Constraints:
1 = |s1|, |s2| = 105
Companies:
AmazonMicrosoftGoogleAtlassianFlipkart + 1 more
Topics:
StringDynamic Programming
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.