
    Develop a function that calculates the number of possible daily traffic patterns, where each day is divided into 2n equal time segments with each segment marked as either normal (0) or congested (1), such that the total number of congested segments in the first n time periods equals the number of congested segments in the last n periods. The resulting count will help identify days with balanced traffic distribution between morning and evening hours.
    

    
def count_binary_seq(n):
    """
    Develop a function that calculates the number of possible daily traffic patterns, where each day is divided into 2n equal time segments with each segment marked as either normal (0) or congested (1), such that the total number of congested segments in the first n time periods equals the number of congested segments in the last n periods. The resulting count will help identify days with balanced traffic distribution between morning and evening hours.
    

    """
def count_binary_seq(n):
    """
    Develop a function that calculates the number of possible daily traffic patterns, where each day is divided into 2n equal time segments with each segment marked as either normal (0) or congested (1), such that the total number of congested segments in the first n time periods equals the number of congested segments in the last n periods. The resulting count will help identify days with balanced traffic distribution between morning and evening hours.
    

    """
    nCr = 1
    res = 1
    for r in range(1, n + 1):
        nCr = nCr * (n + 1 - r) / r
        res += nCr * nCr
    return res