pyassistant

Merge two sorted lists into a sorted list without duplicates

Given two sorted lists of integers (ascending order), merge them into a single sorted list that contains no duplicate values. The input lists may contain duplicates within themselves. Return a new sorted list containing each value that appears in either input exactly once. Example: a = [1, 2, 2, 4], b = [2, 3, 4, 5] -> [1, 2, 3, 4, 5]

Example:

Input:
([1, 2, 2, 4], [2, 3, 4, 5])
Output:
[1, 2, 3, 4, 5]

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.