def get_min_hit_end_distance(l1, l2):
    """
    Given two lists of kmer hit ends on a sequence (from get_kmer_hit_ends()),
    return the minimum distance between two hit ends in the two lists.
    In other words, the closest positions in both lists.

    >>> l1 = [2,10,20]
    >>> l2 = [12,15,30]
    >>> get_min_hit_end_distance(l1,l2)
    2

    """
    assert l1, "l1 empty"
    assert l2, "l2 empty"
    min_dist = 1000000
    for e1 in l1:
        for e2 in l2:
            dist_e1e2 = abs(e1-e2)
            if dist_e1e2 < min_dist:
                min_dist = dist_e1e2
    assert min_dist != 1000000, "no min_dist extracted"
    return min_dist