e
i
d
b
a
o
o
o
[0][1][2][3][4][5][6][7]
Fixed-size window · frequency match
▸1given s1, s2; k ← |s1|2target ← char counts of s13build first window s2[0..k − 1]4 count each char into window5if window counts == target: return true6for right ← k to |s2| − 1:7 remove s2[right − k]; add s2[right]8return false
state
- s1"ab"
- s2"eidbaooo"
- k2