Maximum concurrent load

Write codeMedium25 minMeta style

Your task

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.

Examples

busiest_period(logs: list[list[int]]) -> int
Example 1
Inputbusiest_period([[1, 5, 2], [2, 6, 3], [4, 7, 1]])
Output6