← Sliding Window

Micro-Drill #106 — Minimum window substring check

Sliding Window Target: 10s

Tracking have/need counts is the matching logic inside minimum-window-substring.

need, have = len(cnt_t), 0
for c in window:
    window_cnt[c] += 1
    if window_cnt[c] == cnt_t[c]:
        have += 1

Type it from memory. Go.

Practice Problems

Related Coding Drills

← Micro #105 Micro #107 →