Leetcode 4. Median of Two Sorted Arrays
Find the median of two sorted arrays in O(log(m+n)) time by using binary search to partition the arrays so the left half contains the correct count of smaller elements and all left elements ≤ all right elements. The challenge is doing this efficiently without merging and handling unequal lengths and edge boundaries.
Asked at:
Microsoft
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Early April, 2025
Meta
Senior
Late January, 2025
Intern
Median of two sorted arrays
Hello Interview Premium
Your account is free and you can post anonymously if you choose.