
    Given a sequence of daily patient monitoring data where each reading is marked as either compliant (1) or non-compliant (0), determine how many possible sequences of 2n readings exist where the total number of compliant readings in the first n morning checks equals the total number of compliant readings in the last n evening checks. The value of n represents half the monitoring period length, and each sequence must consist of exactly 2n readings.
    

    
def count_binary_seq(n):
    """
    Given a sequence of daily patient monitoring data where each reading is marked as either compliant (1) or non-compliant (0), determine how many possible sequences of 2n readings exist where the total number of compliant readings in the first n morning checks equals the total number of compliant readings in the last n evening checks. The value of n represents half the monitoring period length, and each sequence must consist of exactly 2n readings.
    

    """
def count_binary_seq(n):
    """
    Given a sequence of daily patient monitoring data where each reading is marked as either compliant (1) or non-compliant (0), determine how many possible sequences of 2n readings exist where the total number of compliant readings in the first n morning checks equals the total number of compliant readings in the last n evening checks. The value of n represents half the monitoring period length, and each sequence must consist of exactly 2n readings.
    

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