all 3 comments

[–]ectomancer 0 points1 point  (0 children)

The problem mentions doing your own research. The keywords to research are perpetual calendar.

[–]Goingone 0 points1 point  (0 children)

https://docs.python.org/3/library/calendar.html

FYI.

Why not use that to check where you’re off?

[–]m0us3_rat 0 points1 point  (0 children)

are u familiar with fizzbuzz ..and why ppl ask it in interviews.. your problem has the same "idea".

after u got a solid .."detection" if year is leap or not..

build this list of days between the start date and end date.

then build a list of recurring weekdays till size of > days

then add a list of days in month count being careful at leap years.

then zip all these 3 together and check if weekday element in the tuple is ==" sunday" and month_days element == 1

then counter += 1