def consolidate_times(times):
    """Consolidates contiguous time intervals for a list of times.
       
       Args:
         times::[(Int, Int)] - The list of times to consolidate. Check the README
           for specifications on format.
       Returns:
         joined_times::[(Int, Int)] - A list of consolidated times.
    """    
    joined_times = []
    if not times: return joined_times
    start, end = times[0]
    for i in range(1, len(times)):
        if end != times[i][0]:
            joined_times.append((start, end))
            start, end = times[i]
        else:
            end = times[i][1]
    joined_times.append((start, end))
    return joined_times