Step 1: Expand window right pointer to include 'A' at index 0
Window: [A] -> null
Have: {A:1}, Need: {A:1, B:1, C:1}Why: Start including characters to cover needed ones
Step 2: Expand right pointer to include 'D' at index 1
Window: [A] -> [D] -> null
Have: {A:1}, Need: {A:1, B:1, C:1}Why: 'D' is not needed, keep expanding
Step 3: Expand right pointer to include 'O' at index 2
Window: [A] -> [D] -> [O] -> null
Have: {A:1}, Need: {A:1, B:1, C:1}Why: 'O' is not needed, keep expanding
Step 4: Expand right pointer to include 'B' at index 3
Window: [A] -> [D] -> [O] -> [B] -> null
Have: {A:1, B:1}, Need: {A:1, B:1, C:1}Why: Found 'B', closer to covering all needed chars
Step 5: Expand right pointer to include 'E' at index 4
Window: [A] -> [D] -> [O] -> [B] -> [E] -> null
Have: {A:1, B:1}, Need: {A:1, B:1, C:1}Why: 'E' not needed, keep expanding
Step 6: Expand right pointer to include 'C' at index 5
Window: [A] -> [D] -> [O] -> [B] -> [E] -> [C] -> null
Have: {A:1, B:1, C:1}, Need: {A:1, B:1, C:1}Why: All needed chars found, try shrinking window
Step 7: Shrink left pointer from 'A' at index 0
Window: [D] -> [O] -> [B] -> [E] -> [C] -> null
Have: {A:0, B:1, C:1}, Need: {A:1, B:1, C:1}Why: Removing 'A' breaks requirement, stop shrinking
Step 8: Expand right pointer to include 'O' at index 6
Window: [D] -> [O] -> [B] -> [E] -> [C] -> [O] -> null
Have: {A:0, B:1, C:1}, Need: {A:1, B:1, C:1}Why: Continue scanning for smaller window
Step 9: Shrink left pointer from 'D' at index 1
Window: [O] -> [B] -> [E] -> [C] -> [O] -> null
Have: {A:0, B:1, C:1}, Need: {A:1, B:1, C:1}Why: 'D' not needed, shrink window
Step 10: Shrink left pointer from 'O' at index 2
Window: [B] -> [E] -> [C] -> [O] -> null
Have: {A:0, B:1, C:1}, Need: {A:1, B:1, C:1}Why: 'O' not needed, shrink window
Step 11: Shrink left pointer from 'B' at index 3
Window: [E] -> [C] -> [O] -> null
Have: {A:0, B:0, C:1}, Need: {A:1, B:1, C:1}Why: Removing 'B' breaks requirement, stop shrinking
Step 12: Expand right pointer to include 'D' at index 7
Window: [E] -> [C] -> [O] -> [D] -> null
Have: {A:0, B:0, C:1}, Need: {A:1, B:1, C:1}Why: 'D' not needed, keep expanding
Step 13: Expand right pointer to include 'E' at index 8
Window: [E] -> [C] -> [O] -> [D] -> [E] -> null
Have: {A:0, B:0, C:1}, Need: {A:1, B:1, C:1}Why: 'E' not needed, keep expanding
Step 14: Expand right pointer to include 'B' at index 9
Window: [E] -> [C] -> [O] -> [D] -> [E] -> [B] -> null
Have: {A:0, B:1, C:1}, Need: {A:1, B:1, C:1}Why: Found 'B' again, all needed chars present
Step 15: Shrink left pointer from 'E' at index 4
Window: [C] -> [O] -> [D] -> [E] -> [B] -> null
Have: {A:0, B:1, C:1}, Need: {A:1, B:1, C:1}Why: 'E' not needed, shrink window
Step 16: Shrink left pointer from 'C' at index 5
Window: [O] -> [D] -> [E] -> [B] -> null
Have: {A:0, B:1, C:0}, Need: {A:1, B:1, C:1}Why: Removing 'C' breaks requirement, stop shrinking
Step 17: Expand right pointer to include 'A' at index 10
Window: [O] -> [D] -> [E] -> [B] -> [A] -> null
Have: {A:1, B:1, C:0}, Need: {A:1, B:1, C:1}Why: Found 'A' again, but still missing 'C'
Step 18: Expand right pointer to include 'N' at index 11
Window: [O] -> [D] -> [E] -> [B] -> [A] -> [N] -> null
Have: {A:1, B:1, C:0}, Need: {A:1, B:1, C:1}Why: 'N' not needed, keep expanding
Step 19: Expand right pointer to include 'C' at index 12
Window: [O] -> [D] -> [E] -> [B] -> [A] -> [N] -> [C] -> null
Have: {A:1, B:1, C:1}, Need: {A:1, B:1, C:1}Why: All needed chars present again, try shrinking
Step 20: Shrink left pointer from 'O' at index 6
Window: [D] -> [E] -> [B] -> [A] -> [N] -> [C] -> null
Have: {A:1, B:1, C:1}, Need: {A:1, B:1, C:1}Why: 'O' not needed, shrink window
Step 21: Shrink left pointer from 'D' at index 7
Window: [E] -> [B] -> [A] -> [N] -> [C] -> null
Have: {A:1, B:1, C:1}, Need: {A:1, B:1, C:1}Why: 'D' not needed, shrink window
Step 22: Shrink left pointer from 'E' at index 8
Window: [B] -> [A] -> [N] -> [C] -> null
Have: {A:1, B:1, C:1}, Need: {A:1, B:1, C:1}Why: 'E' not needed, shrink window
Step 23: Shrink left pointer from 'B' at index 9
Window: [A] -> [N] -> [C] -> null
Have: {A:1, B:0, C:1}, Need: {A:1, B:1, C:1}Why: Removing 'B' breaks requirement, stop shrinking
Step 24: Shrink left pointer from 'A' at index 10
Window: [N] -> [C] -> null
Have: {A:0, B:0, C:1}, Need: {A:1, B:1, C:1}Why: Removing 'A' breaks requirement, stop shrinking
Result: Window: [B] -> [A] -> [N] -> [C] -> null
Smallest substring: "BANC"