Back to problems

Subtract Blocked Periods from Allowed Deployment Windows

Algorithm · Stripe · Medium

You are given two lists of half‑open time intervals with integer endpoints: allowed and blocked. Each interval is of the form [start, end), where the deployment is allowed to start at or after start and must stop before end. The allowed list indicates times when the deployment could potentially run, and the blocked list indicates times when deployment is strictly prohibited. A moment is considered available if it lies inside at least one allowed interval and not inside any…

Checking your access…