1. 程式人生 > ># LeetCode 4 ## problem4

# LeetCode 4 ## problem4

there RR [] time IT amp then ear arrays

# LeetCode 4
## problem4
---
There is a very obscure condition here:

* i + j == m - i + n - j
* i means the index of the first array.
* j means the index of the second array.
* m means the sum of the length of the two arrays.

And the second condition is that :

* If the a[i] >= b [j-1] && b[j] >= a[i-1],the i and j are the final result that we want.
* The a[] and b[] are the two arrays.

Then we can apply these two conditions into our binary search.

The time complexity of the solution is O(min(m,n)).

# LeetCode 4 ## problem4