def _find_continuous_segment(numbers):
    """Find the longest continuous segment in a list of numbers.
    For example:
        input:
                1, 2, 3, 4, 5, 6
               22,70,23,24,25,26
        output:
            number_list_sorted:
                1, 3, 4, 5, 6, 2
               22,23,24,25,26,70
            segments:
                0, 1, 5, 6
            which means there are 3 segment with start and end indices
            on the number_list_sorted to be: (0, 1), (1, 5), (5, 6)

    Args:
        numbers: List of pairs of number

    Returns:
        segment: a list containing the indices of the segment start point
            and end point.
        number_list: sorted by the first element version of the input.

    """
    segments = [0]
    number_list_sorted = sorted(numbers, key=lambda elem: elem[0])
    for i in range(len(number_list_sorted) - 1):
        # continuous segment is a segment which the number in pair is 1 unit
        # more than the previous pair
        if (number_list_sorted[i + 1][0] - number_list_sorted[i][0] != 1
                or number_list_sorted[i + 1][1] - number_list_sorted[i][1] != 1):
            segments.append(i + 1)
    segments.append(len(number_list_sorted))
    return segments, number_list_sorted