A consolidated order feed aggregator at Citadel and HRT receives two independent sorted streams of executed transaction prices, nums1 (size ) and nums2 (size ).
Both feeds are sorted in non-decreasing numerical order. To establish the benchmark mid-market price across both venues, calculate the overall median price of the combined dataset.
Your Task
Implement find_median_sorted_arrays(nums1: list[float], nums2: list[float]) -> float that returns the median price in strictly time without merging the two arrays into memory.
Constraints
Examples
nums1 = [1.0, 3.0]
nums2 = [2.0]
# Combined sorted: [1.0, 2.0, 3.0]. Median = 2.0
# Output: 2.0
nums1 = [1.0, 2.0]
nums2 = [3.0, 4.0]
# Combined sorted: [1.0, 2.0, 3.0, 4.0]. Median = (2.0 + 3.0) / 2 = 2.5
# Output: 2.5