Hi there,
I am wondering how can we do this task:

Given two sorted integer arrays (array size may differ).

Find the number of values that appear in both arrays.

For example, given:
A: 1, 3, 5, 8, 10. 14, 16, 25, 28, 47
B: 2, 4, 7, 8, 11, 12, 14, 17, 47, 56, 64

The result should be 3, since value 8, 14, 47 appear in both array.
A merge sort like method will run in O(n+m) time.
Can we do better than that? 

Thanks a lot. :-)

Reply via email to