find interval of two sorted arrays