Your question is Intersection of Two Sets. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
An IBM watsonx data pipeline receives two unsorted lists of integer tags. Return their intersection as a list of unique values, preserving the order in which values first appear in the first list.
Although the inputs are lists and may contain duplicates, treat each list as a mathematical set for membership. The output must contain each common value exactly once. Do not modify either input list.
Implement intersection_preserving_order(nums1, nums2).
nums1 and nums2.nums1.def intersection_preserving_order(nums1, nums2):