Algorithm · LinkedIn · Medium
In a concurrent setting, you receive log records marking when tasks begin and finish. Determine both the inclusive duration and the exclusive duration of every task. Implement: Each item in logs is a string describing either a task start, formatted as start:task_id:timestamp, or a task completion, formatted as end:task_id:timestamp. Example Input: Output: Y runs from timestamp 3 through 4, so both of its durations are 2. X spans timestamps 1 through 7 for an inclusive time…
Checking your access…