Python 3.8 (pre-release), 9084 bytes
-6 bytes thanks to Gloweye
lambda s,e,n:[d for i in range((e-s).days+1)if-len(set(d:=str(s+s+type(e-s).__class__(i))))==~n]
An unnamed function which returns a list of strings (counting/including leading zeros) that accepts three arguments:
s
, the start - adatetime.date
object;e
, the end - adatetime.date
object; andn
, the number of days - anint
object.
Note: As the function accepts datetime.date
objects I have not counted the import code for that (and have worked around importing the datetime.timedelta
object as it is indirectly accessible via subtraction of these input objects).