Stores the minimum and maximum day in the ranges
int min_day = ranges . get ( 0 ) . get ( 0 ) ; int max_day = 0 ; for ( int i = 0 ; i < N ; i ++ ) max_day = Math . max ( max_day , ranges . get ( i ) . get ( 1 ) ) ; int index = 0 , count_jobs = 0 ;