Please create a factory for this question:

There are four elements that need to be generated for this question, the length of the string, the size of the alphabet, and the two start and end substrings. These substrings need to have a combined length that is less than the total length for this question to work.
A guide for the math used for this question can be found here.
Here is the string formatting for the above screenshot:
`
Consider strings of length 4 over the alphabet $\{a,b,c,d\}$. How many such strings are there that start with $ad$ or end with $dcb$?
17, 18 ,19 (correct), 20
`
Please copy the way this file generates questions.
Please create a factory for this question:
There are four elements that need to be generated for this question, the length of the string, the size of the alphabet, and the two start and end substrings. These substrings need to have a combined length that is less than the total length for this question to work.
A guide for the math used for this question can be found here.
Here is the string formatting for the above screenshot:
Please copy the way this file generates questions.