3. How many permutations of the string " 000011112222 " contain the substring " 2020 "?
Answer: 3575
Solution: Removing the string " 2020 ", there are two 0's, four 1's, and two 2's remaining. There are $\frac{8!}{2!4!2!}=420$ ways to arrange these digits, multiplied to 9 possible placements for the string " 2020 ", for a product of 3780 .
However, by PIE, we still need to subtract the number of arrangements with string "202020" and add back the number of arrangements with string " 20202020 ", each of which account for $7 \cdot \frac{6!}{1!4!1!}=210$ and $5 \cdot \frac{4!}{0!4!0!}=5$ arrangements, respectively. This gives us a total of $3780-210+5=3575$ possible permutations.