You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can use regex to find all overlapping matches of each pattern: https://stackoverflow.com/questions/4664850/how-to-find-all-occurrences-of-a-substring
We store the length of the pattern, and the position at which it has been seen in a list. Then when iterating, we keep a decrementing counter, and when it reaches zero, we are no longer in a match.