Problem 3297 · Medium

Count Substrings That Can Be Rearranged to Contain a String I

A substring can be rearranged to start with word2 when it holds at least as many of each letter as word2 does.

Open the interactive visualisation