Check if given interval overlap with previously included interval , if not then include this interval and update the end point of last added interval
if ( l1 > r1 ) { document . write ( " " + l1 + " " + r2 + " " + " " ) ; r1 = r2 ; } } }