Is the order inside the same-day window
A city courier offers same-day delivery for orders placed by a cutoff hour. Orders have a leadTime of minutes; return whether the order still makes the window.
- Give the answer for an order where leadTime minutes remain before the cutoff expires.
- Any remaining leadTime of at least 1 minute is still enough — the cutoff is inclusive.
same_day_window(lead_minutes: int, cutoff_minutes: int) → bool
Where you start
def same_day_window(lead_minutes: int, cutoff_minutes: int) -> bool:
Worked examples
| Call | Result |
|---|---|
same_day_window(30, 60) | True |
same_day_window(60, 60) | True |
same_day_window(61, 60) | False |
same_day_window(90, 0) | False |
Hint
Compare two integers.
Reference solution in Python
def same_day_window(lead_minutes: int, cutoff_minutes: int) -> bool:
return lead_minutes <= cutoff_minutes