Problem statement:
Design an algorithm that, given two lists of integers, creates a list consisting of those integers that appear in both lists (each integer on the final list should appear only once). Describe your algorithm in terms of a pseudocode focusing on main algorithmic tasks and not on low-level details. Analyze the running time of your algorithm. You will get full credit only if your algorithm achieves an asymptotically better worst-case performance than Θ(n^2), where n is the sum of the lengths of the two input lists
Can someone explain to me what this question is actually asking me to do?
My attempt:
I was under the impression that this question was telling me to make a algorithm that has two lists, idk, so maybe two arrays, one A, one B, where those arrays would be filled with numbers and I would take both of those lists and essentially put them together? I used MergeSort to sort them (which now I think may not be necesarry) then I used Merge to put the two lists actually together.
Question:
I am being told that is wrong. I'm thinking I must be misinterpeting the question. I also used merge sort because its O(nlogn).
What is the problem with my answer, what am I missing?