
    Given a sequence of credit card transactions where each transaction is marked as either matching (1) or deviating (0) from typical spending patterns, find the time window that shows the highest disparity between the number of deviating and matching transactions. The identified window will help pinpoint periods of potentially suspicious activity that warrant further investigation.
    

    
def find_length(string):
    """
    Given a sequence of credit card transactions where each transaction is marked as either matching (1) or deviating (0) from typical spending patterns, find the time window that shows the highest disparity between the number of deviating and matching transactions. The identified window will help pinpoint periods of potentially suspicious activity that warrant further investigation.
    

    """
def find_length(string):
    """
    Given a sequence of credit card transactions where each transaction is marked as either matching (1) or deviating (0) from typical spending patterns, find the time window that shows the highest disparity between the number of deviating and matching transactions. The identified window will help pinpoint periods of potentially suspicious activity that warrant further investigation.
    

    """
    n = len(string)
    current_sum = 0
    max_sum = 0
    for i in range(n):
        current_sum += 1 if string[i] == '0' else -1
        if current_sum < 0:
            current_sum = 0
        max_sum = max(current_sum, max_sum)
    return max_sum if max_sum else 0