runtime
208 / 500
question 208 Dates Numbers & Regex · medium

The next business day

Refunds are paid on the next business day after they're approved: not a Saturday or Sunday, and not a public holiday.

Functionnext_business_day(day_text, holidays)
day_textYYYY-MM-DD, the approval date
holidaysa list of YYYY-MM-DD texts
Returnsthe first date after day_text that is Monday–Friday and not a holiday, as YYYY-MM-DD
Examples
callnext_business_day('2024-12-20', [])returns'2024-12-23'
callnext_business_day('2024-12-24', ['2024-12-25'])returns'2024-12-26'
callnext_business_day('2024-12-31', ['2025-01-01'])returns'2025-01-02'

Loading your progress…

The next business day — Python practice · Runtime