Given a set of intervals, look for overlaps and then reduce them to a set of non-overlapping intervals.

For example: