def join_overlapping(s, e):
    """Join overlapping intervals.

    Transforms a list of possible overlapping intervals into non-overlapping
    intervals.

    Parameters
    ----------
    s : list
        List with start of interval sorted in ascending order
    e : list
        List with end of interval.

    Returns
    -------
    tuple
        `tuple` (s, e) of non-overlapping intervals.
    """
    rs = []
    re = []
    n = len(s)
    if n == 0:
        return (rs, re)
    l = s[0]
    r = e[0]
    for i in range(1, n):
        if s[i] > r:
            rs.append(l)
            re.append(r)
            l = s[i]
            r = e[i]
        else:
            r = max(r, e[i])
    rs.append(l)
    re.append(r)
    return (rs, re)