Guru Level
Implement the method minimumWindowLength that returns the length of the smallest substring containing all required characters.
Find the shortest contiguous substring of s that contains every character of t, including repeated characters.
The task is designed to test careful handling of edge cases, not only the most common input.
- Return
0if no valid window exists. - Return the length, not the substring text.
- Character frequency matters.
Count required characters from t, expand the right side until valid, then shrink the left side while validity remains.