Say you have been given a start and end time.
You are also given an array of tasks described by their start and end times. These tasks may overlap (i.e., several tasks may be performed simultaneously). I need to find a way to determine how much time was spent on downtime and no work was done.
Of course, if only one task can be started at any time, I could just subtract the time of each task, but part of the overlap puzzled me.
source
share