As reported: Microsoft SWE intern (2024 internship cycle), round 1: LeetCode Median of Two Sorted Arrays — approaches explained, then coded; all tests passed.
Given two sorted arrays nums1 (size m) and nums2 (size n), return the median of the combined sorted sequence. The overall run time should be O(log (m + n)).
This is LeetCode 4 — Median of Two Sorted Arrays.
Example 1
nums1 = [1,3], nums2 = [2] -> 2.00000
Example 2
nums1 = [1,2], nums2 = [3,4] -> 2.50000
Constraints: 0 ≤ m, n ≤ 1000; 1 ≤ m + n ≤ 2000; -10^6 ≤ nums1[i], nums2[i] ≤ 10^6.
Code runner format: one JSON value per line: nums1, nums2 (LeetCode's test-case format). Implement findMedianSortedArrays(nums1, nums2); the harness prints the result with 5 decimals.