Code RoomPeak concurrent job capacity
EasyPrep Room Coding #487

Peak concurrent job capacity

CodingAlgorithms & data structuresEntry–Mid~13 min

A batch scheduler divides the day into n numbered slots (0 to n-1). Each scheduled job is a triple [start, end, amount]: it occupies every slot from start through end inclusive and consumes `amount` units of server capacity while it runs (0 <= start <= end < n, amount > 0). Jobs overlap freely. Return the peak total capacity consumed in any single slot; with no jobs scheduled, the peak is 0. Example: n = 4, jobs = [[0, 2, 3], [1, 3, 2]] gives 5 — slot loads are [3, 5, 5, 2].

Implement
peak_slot_load(n: int, jobs: list[list[int]]) → int
Examples
in[4,[[0,2,3],[1,3,2]]]out5
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 13 min
InputExpectedGot
[4,[[0,2,3],[1,3,2]]]5not run yetsample