bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
HardSliding WindowLC 76

Minimum Window Substring

Given two strings s and t 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 " ". The testcases will be generated such that the answer is unique.

Asked at 27 companies
AdobeAirbnbAmazon
Hints
  • 1.Think about what data structure fits Minimum Window Substring
  • 2.Consider the brute force complexity and how to optimize
  • 3.Can you trade space for time?
LeetCodeNeetCode