Drill

ProblemsJavaScript › logistics

Is the order inside the same-day window

easylogisticsJavaScript

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

Solve it in the editor →

Where you start

function sameDayWindow(leadMinutes, 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 JavaScript
function sameDayWindow(leadMinutes, cutoffMinutes) {
  return leadMinutes <= cutoffMinutes;
}

The same problem in another language

More logistics problems in JavaScript