def tabulate_endpoints_sparse(walks):
    """
    Compute the endpoint of each walk that is provided and return a dictionary
    that maps to each possible endpoint the number of walks (1 or more) that
    end in this endpoint. This implementation uses a Python `dict`.
    """
    endpoints = {}
    for walk in walks:
        x, y = 0, 0
        i = 0
        quarter_plane = True
        for step in walk:
            x += step.x
            y += step.y
            i += 1
            if x < 0 or y < 0:
                quarter_plane = False
                break
        if quarter_plane:
            if not (x, y) in endpoints:
                endpoints[x, y] = 0
            endpoints[x, y] += 1
    return endpoints
