count to 0 to keep track of the number of non-covered intervals.count and update the previous interval to the current one.
b. If the current interval is covered by the previous one, continue to the next interval without incrementing count.count.