persimpangan dua vektor

You need to sort just the smaller vector. 
Then do a single pass over the bigger vector and test a presence 
of its items in a smaller vector by using a binary search.

(works in distinct elements of array)
Obnoxious Oryx