Does s2 contain any permutation of s1? A permutation is just a rearrangement —
so it's a window of length s1.length whose character frequencies exactly match
s1's. Slide a fixed window across s2, comparing counts.
Execution
idle
need (from s1) vs window (current)
Press Run to begin.
0 / 0
Speed
Java · running line
windowneedmismatchmatch found
O(n) time · O(1) space (26 letters) · the window size is fixed at s1.length — this is a fixed window that happens to compare frequency tables.