- Median of Two Sorted Arrays 难度 困难
5571
收藏
分享 切换为中文 接收动态 反馈 Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n)).
Example 1:
Input: nums1 = [1,3], nums2 = [2] Output: 2.00000 Explanation: merged array = [1,2,3] and median is 2. Example 2:
Input: nums1 = [1,2], nums2 = [3,4] Output: 2.50000 Explanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5.
Constraints:
nums1.length == m nums2.length == n 0 <= m <= 1000 0 <= n <= 1000 1 <= m + n <= 2000 -106 <= nums1[i], nums2[i] <= 106 通过次数744,081提交次数1,794,676 请问您在哪类招聘中遇到此题?
社招
校招
实习
未遇到 贡献者 LeetCode 相关企业 半年内半年 ~ 1年1年 ~ 2年 亚马逊 Amazon|37 字节跳动|24 苹果 Apple|20 微软 Microsoft|19 高盛集团 Goldman Sachs|19 谷歌 Google|14 Facebook|11 彭博 Bloomberg|5 领英 LinkedIn|3 PayPal|3 相关标签 Array Binary Search Divide and Conquer
题目列表