Drill

ProblemsGo › logistics

Is the order inside the same-day window

easylogisticsMathGo

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

Go 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

func sameDayWindow(leadMinutes int, cutoffMinutes int) bool {
	
}

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 Go
func sameDayWindow(leadMinutes int, cutoffMinutes int) bool {
	return leadMinutes <= cutoffMinutes
}

The same problem in another language

More logistics problems in Go