ASAPUtils Logo ASAPUtils
Week 2

Minimum Window Substring

Minimum Window Substring with a need and have counter pair, with C++ and JavaScript solutions, a visualizer, and the shrink-while-valid inversion that separates minimising windows from maximising ones.

The problem

Given strings s and t, return the shortest substring of s that contains every character of t including duplicates. If no such substring exists, return the empty string.

s = "ADOBECODEBANC", t = "ABC" -> "BANC"

Related Problems