Drill

ProblemsTypeScript › logistics

Is the order inside the same-day window

easylogisticsTypeScript

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: number, cutoffMinutes: number): boolean {
  
}

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

The same problem in another language

More logistics problems in TypeScript