 All Problems
Median of Two Sorted Arrays
hard
binary search
arrays
divide and conquer
amazon
google
microsoft
apple

Given two sorted arrays of integers, find the k-th smallest element in their merged sorted sequence. (Simpler version of median-of-two-sorted-arrays.)

Example 1:

Input:
1 3 5
2 4 6
k: 4
Output: 4

Example 2:

Input:
1 2
3 4
k: 3
Output: 3

Input format: Line 1: sorted array A. Line 2: sorted array B. Line 3: k.

Output format: k-th smallest element.

Run to check your code against the sample cases, or submit to run every case