def slices_union(seq):
    """Sort 2-tuples and combine them as if right-open intervals."""
    out = []
    for (start, end) in sorted(seq):
        if len(out) < 1 or out[-1][1] < start:
            out.append((start, end))
        else:
            out[-1] = (out[-1][0], end)
    return out