How To Find Union And Intersection Of Intervals