136. find median of two sorted array

JavaScriptAlgorithm
Is this helpful ?

medium  - accepted / - tried

Given two sorted array of integers, please return the median.

median([1,2],[3,4,5])
// 3

If there are even numbers, return the average.

median([1,2],[3,4])
// 2.5

follow-up

What is the time & space cost of your approach? Could you do better?

Let's try to solve this problem within 10 minutes.

Discuss(33)