Deviopath › Go

Median of Two Sorted Arrays

Hard · Algorithms

a and b are sorted. Return the median as float64. If the combined length is even, average the two middle values.

Write Median(a, b). A linear merge is fine.

Next: Word Break