Drill

ProblemsPython › logistics

Is the order inside the same-day window

easylogisticsPython

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.

same_day_window(lead_minutes: int, cutoff_minutes: int) → bool

Solve it in the editor →

Where you start

def same_day_window(lead_minutes: int, cutoff_minutes: int) -> bool:
    

Worked examples

CallResult
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

The same problem in another language

More logistics problems in Python