标签:exit cond apply problem ble leetcode -- code com
# 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)).
标签:exit cond apply problem ble leetcode -- code com
原文地址:https://www.cnblogs.com/xintt/p/8850291.html