Drill

ProblemsC# › logistics

Is the order inside the same-day window

easylogisticsMathC#

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.

SameDayWindow(leadMinutes: int, cutoffMinutes: int) → bool

C# needs a compiler and Drill does not host one yet, so this page is the reference rather than an exercise: the problem, worked examples, and the solution in full. To type it out, the same problem runs in Python.

Solve it in Python →

Where you start

public bool SameDayWindow(int leadMinutes, int cutoffMinutes) {
    
}

Worked examples

CallResult
SameDayWindow(30, 60)true
SameDayWindow(60, 60)true
SameDayWindow(61, 60)false
SameDayWindow(90, 0)false

Hint

Compare two integers.

Reference solution in C#
public bool SameDayWindow(int leadMinutes, int cutoffMinutes) {
    return leadMinutes <= cutoffMinutes;
}

The same problem in another language

More logistics problems in C#