Dsa
Math
Easy
Median of Two Arrays
Write a program to find the median of two sorted arrays of integers. Each array can have different lengths but will be non-empty. Read two lines, each containing space-separated integers that represent the arrays.
Input format:
Two lines of integers.
Output format:
A single float or integer representing the median.
Example:
Input:
1 3 8
7 9 10 11
Output:
8.0
Key concepts
matharrayssorting
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now