Given a set of intervals (start  and end) determine all the gaps and their duration

for example

Note - the intervals may overlap.