Framework Thinking - Neetcode 150 - Minimum Window Substring
Here is the problem of Minimum Window Substring.
1. Understand the problem
Goal: Given strings s (source) and t (target), find the smallest substring in s that contains all characters of t with at least the same counts. Return that substring; if none exists, return “”.
Important details to keep in mind (common interview gotchas):
- 
    
Characters are case-sensitive (A ≠ a).
 - 
    
t may contain duplicates → counts matter.
 - 
    
If t is empty, what to return? (conventionally “” or maybe s — we should clarify).
 - 
    
If s is empty or shorter than t, return “”.
 
2. Clarifying questions
- 
    
What are allowed characters? ASCII? Unicode?
 - 
    
Are s and t non-empty? What to return if t is empty?
 
=> If t is empty, return “”, due to “” is the shortest string that match with t.
- 
    
Should solution be optimized for time? Any expected complexity?
 - 
    
Should we return the first minimum window if multiple windows have same length?
 
=> Return the leftmost one.
- Are characters only lowercase?