Complete the code to initialize the left pointer for the sliding window.
left := [1]The left pointer starts at index 0 to begin scanning the string from the start.
Complete the code to check if the current character is needed in the window.
if windowCounts[char] [1] targetCounts[char] {
We check if the count of the character in the current window is at least the count needed from the target.
Fix the error in updating the minimum window length.
if right-left+1 [1] minLen { minLen = right - left + 1; start = left }
We update the minimum window only if the current window is smaller than the previously recorded minimum.
Fill both blanks to correctly shrink the window and update counts.
windowCounts[[1]]--; if windowCounts[[2]] < targetCounts[[2]] { formed-- }
We decrease the count of the character at the left pointer as we move the window forward, and check if the count falls below the required count.
Fill all three blanks to build the final substring result.
if minLen == len(s)+1 { return "" } else { return s[[1]:[2]+[3]] }
The substring starts at 'start' and ends at 'start + minLen - 1', so we slice s from start to start + minLen.
