from typing import Sequence


def is_overlapping_lane_seq(lane_seq1: Sequence[int], lane_seq2: Sequence[int]) -> bool:
    """
    Check if the 2 lane sequences are overlapping.
    Overlapping is defined as::

        s1------s2-----------------e1--------e2

    Here lane2 starts somewhere on lane 1 and ends after it, OR::

        s1------s2-----------------e2--------e1

    Here lane2 starts somewhere on lane 1 and ends before it

    Args:
        lane_seq1: list of lane ids
        lane_seq2: list of lane ids

    Returns:
        bool, True if the lane sequences overlap
    """

    if lane_seq2[0] in lane_seq1[1:] and lane_seq1[-1] in lane_seq2[:-1]:
        return True
    elif set(lane_seq2) <= set(lane_seq1):
        return True
    return False