Your question is Day-of-Week Logic. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Recursion Pharmaceuticals schedules experiment milestones using Gregorian calendar dates. Given a target date, a reference date with a known weekday, and the reference weekday, calculate the target date's weekday without using Python's date or calendar libraries.
Implement a function that supports dates before or after the reference date. Use the proleptic Gregorian calendar, including the rule that century years are not leap years unless divisible by 400.
Input consists of two dates represented as [year, month, day], plus the reference weekday as one of Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, or Sunday. Return the target date's weekday as a string.
The reference date is guaranteed to be valid, and the target date may occur on either side of it. The weekday supplied for the reference date is correct.
def weekday_from_reference(target_date, reference_date, reference_weekday):