Code Room
CodingMediumcod-g197
Subject Sweep lineLevel Mid–Senior~25 minCommon in Algorithms & data structures interviewsIndustries Software development, Technology

Question

You are given a list of activity logs, each [start, end, weight], where an activity contributes its weight to the system load over the half-open time window [start, end). Return the maximum total weight that is simultaneously active at any single instant. If an activity ends at the same time another begins, they do NOT overlap. The list has at least one log.

Implement
busiest_period(logs: list[list[int]]) → int
Examples
in[[[1,5,2],[2,6,3],[4,7,1]]]out6
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.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.