Dsa
Heap
Hard
Median of Two Sorted Arrays
Given two sorted arrays `nums1` and `nums2`, write a function to find the median of the two sorted arrays. The overall run time complexity should be O(log(min(n, m))), where n and m are the sizes of the arrays. You should implement the function `findMedianSortedArrays(nums1: List[int], nums2: List[int]) -> float`.
### Input
The first line contains two integers `n` and `m` (0 ≤ n, m ≤ 10^5), which are the sizes of the two arrays. The second line contains `n` integers and the third line contains `m` integers.
### Output
Print the median of the two sorted arrays as a float.
### Example
Input:
3 3
1 3 8
7 9 10
Output:
8.0
Key concepts
heapsorted arraysmedian
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now