Finding intersection of two arrays can be done if you sort the 2 arrays and then do a linear step through to record the common elements. This would take O(nlogn) + O(nlogn) + O(n)
Alternatively, you could compare each element in the first array with each element in the second array and you would get a O(n^2) run-time complexity.
How can I prove the first approach is better than the second?