Additionally, we can incorporate a priority queue within the algorithm to manage the intervals more effectively. For simplicity, we assume that both the start and end times of the intervals are represented as integers. Below is a potential implementation in Python: import heapq def available_times ( schedules ) : times = [ ] for i , schedule in enumerate ( schedules ) : for time in schedule : start , end = time times . append ( ( start , i , False ) ) times . append ( ( end , i , True ) ) heapq . heapify ( times ) overlaps = [ 0 ] * len ( schedules ) intervals = [ ] while times : time , user , is_end = heapq . heappop ( times ) overlaps [ user ] = 0 if is_end else 1 if sum ( overlaps ) == 0 and times : intervals . append ( ( time , times [ 0 ] [ 0 ] ) ) return intervals In this code, we utilize the heapq module to create a priority queue for all time intervals, while the overlaps list tracks the overlaps among users. During each iteration, if the total number of overlaps is zero, it indicates that everyone is free during that time slot from the current time to the start of the next time slot, prompting us to add that time slot to our list of available times.