def _set_false_get_count(arr, start, stop):
    """Set the arr[start:stop] to False, counting the number of True set."""
    count = 0
    for i in range(start, stop):
        if arr[i]:
            count += 1
            arr[i] = False
    return count