BUG LAB · Sliding window
Two As are not one
A minimum window solution checks only whether every distinct target character is present. Which target exposes the missing counts?
Java · intentionally broken snippet
Set<Character> need = new HashSet<>();
for (char c : target.toCharArray()) need.add(c);
// Accept a window whenever it contains every char in need.Assume ordinary supporting code and valid inputs unless the question states otherwise.
Choose an answer before revealing the trace. Keys 1 to 3 work too.