Approach hintTry it first, then revealHide
Compare the letter counts of s1 with those of a window of the same length sliding across s2. Maintaining how many of the 26 letters currently match makes each shift O(1).
Compare the letter counts of s1 with those of a window of the same length sliding across s2. Maintaining how many of the 26 letters currently match makes each shift O(1).