get common subset

find the common subset of two sorted arrays