You are given a list of tasks running on servers. Each task is represented as a pair (start, duration):
start
is the start time in
minutes from the start of a day
, where
0 <= start < 1440
.
duration
is the runtime in minutes (
duration > 0
).
start + duration > 1440
, the task
wraps past midnight
into the next day. Durations may be larger than 1440 (spanning multiple days).
Return the minimum number of servers required so that all tasks can run without overlap on the same server.
Clarification: Treat each task as an interval on a real timeline starting at day 0; wrapping means the interval crosses into day 1 (or beyond). Two tasks overlap if their running time intervals intersect.
Example:
tasks = [(1380, 60), (0, 30), (1380, 30)]
Expected output: 2