def jaccard(a, b):
    """Compute the Jaccard distance between two strings.

    :type a: str

    :type b: str

    :returns: float
    """
    if not a and not b:
        return 0
    n = len(a.intersection(b))
    return 1 - float(n) / (len(a) + len(b) - n)
