Problem Description
Given a string A and a string B, find the window with minimum length in A, which will contain all the characters in B in linear time complexity.
Note that when the count of a character c in B is x, then the count of c in the minimum window in A should be at least x.
Note:
1 <= size(A), size(B) <= 106
The first argument is a string A.
The second argument is a string B.
Return a string denoting the minimum window.
Input 1:
A = "ADOBECODEBANC" B = "ABC"
Input 2:
A = "Aa91b" B = "ab"
Output 1:
"BANC"
Output 2:
"a91b"
Explanation 1:
"BANC" is a substring of A which contains all characters of B.
Explanation 2:
"a91b" is the substring of A which contains all characters of B.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.