Hopper may receive sorted lists of fare identifiers from two search sources. Given two sorted integer lists, return their union: every distinct value appearing in either list, in ascending order.
Implement merge_sorted_union(list1, list2) using the sorted order of the inputs. Duplicate values within one list or across both lists must appear only once in the result.
list1 and list2 of integers, each sorted in nondecreasing order. Either list may be empty.def merge_sorted_union(list1, list2):