
    Given a sequence of road segments where each segment is marked as either congested (1) or clear (0), find the longest stretch of road that provides the maximum advantage of clear segments over congested ones. The advantage is calculated as the difference between the number of clear segments minus the number of congested segments in any continuous portion of the route.
    

    
def find_length(string):
    """
    Given a sequence of road segments where each segment is marked as either congested (1) or clear (0), find the longest stretch of road that provides the maximum advantage of clear segments over congested ones. The advantage is calculated as the difference between the number of clear segments minus the number of congested segments in any continuous portion of the route.
    

    """
def find_length(string):
    """
    Given a sequence of road segments where each segment is marked as either congested (1) or clear (0), find the longest stretch of road that provides the maximum advantage of clear segments over congested ones. The advantage is calculated as the difference between the number of clear segments minus the number of congested segments in any continuous portion of the route.
    

    """
    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