Your question is Median and Linked List Algorithms. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A WePay Checkout integration receives two independently sorted sequences of numeric transaction amounts. Given the two sorted arrays, return the median of all amounts without explicitly merging them.
The median is the middle value when the combined values are ordered. If the combined length is even, return the average of the two middle values.
Implement median_two_sorted_arrays(nums1, nums2), where nums1 and nums2 are sorted lists of integers or floating-point numbers. Return the median as a number. At least one array is non-empty.
Your solution should run in O(log(min(m, n))) time and use O(1) additional space, where m and n are the array lengths.
def median_two_sorted_arrays(nums1, nums2):