# LeetCode 4 ## problem4

Posted xintt

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了# LeetCode 4 ## problem4相关的知识,希望对你有一定的参考价值。

# 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的主要内容,如果未能解决你的问题,请参考以下文章

4. 两个有序数组的中值 [leetcode 4: Median of Two Sorted Arrays]

2017-3-4 leetcode 414

leetcode笔记:Perfect Squares

# LeetCode 4 ## problem4

leetcode4-majorityElement

LeetCode:汇总区间228