← All problemsSign in

Find the Median

You are given an array of $N$ numbers, where $N$ is a positive $\textbf{even}$ integer. The array contains $1$ copy of each of the integers from $1$ to $N$. Now, we remove an element $X$ from this array. It is guaranteed that $X$ exists in the array before removal. Your task is to determine the median of the new array. The median of a list of $K$ integers, where $K$ is odd, is defined as the

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start