Closest pair sum in two sorted arrays

后端 未结 3 486
感动是毒
感动是毒 2021-01-03 04:40

Given two sorted arrays of integers, a and b, and an integer c, I have to find i,j such that:

a[i] + b[j]         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-03 05:21

    Thinking a bit about it, then you could ask yourself:
    "Is it necessary, each time, to search in the sorted b-array for successive values from a[]?"

提交回复
热议问题