Solution for Median of Two Sorted Arrays