Minimum Window Substring Problem
Minimum Window Substring Problem — ExecCode Hard DSA Practice
Solve the Minimum Window Substring problem on ExecCode. Free online hard DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.
Problem description
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.
Examples
Input s = "ADOBECODEBANC", t = "ABC"; Output "BANC". Input s = "a", t = "a"; Output "a". Input s = "a", t = "aa"; Output ""
Constraints
m == s.length n == t.length 1 <= m, n <= 10^5 s and t consist of uppercase and lowercase English letters
Practice Minimum Window Substring free on ExecCode. Browse DSA problems, topic map, and placement guides.