Problem: Median of Two Sorted Arrays
Find the median of two sorted arrays.
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
Constraints
- nums1.length == m
- nums2.length == n
- 0 <= m <= 1000
- 0 <= n <= 1000
- 1 <= m + n <= 2000
- -10^6 <= nums1[i], nums2[j] <= 10^6
Example
Input: nums1 = [1,3], nums2 = [2]
Output: 2.0
Complexity
- Time: O(log(min(m, n)))
- Space: O(1)
Contribution Guidelines
- Implement in one language (we'll add others later)
- Include README with problem statement and test cases
- Add test harness in your implementation
- Follow code style guide in .gemini/styleguide.md
Problem: Median of Two Sorted Arrays
Find the median of two sorted arrays.
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
Constraints
Example
Input: nums1 = [1,3], nums2 = [2]
Output: 2.0
Complexity
Contribution Guidelines