K Median
You have an array $A$ of $N$ integers, and an integer $K$. You must delete exactly $K$ elements from the array. After deleting $K$ elements, you wonder what are the possible median values of the remaining array. Print all of the possible median values. --- The median of an array $B$ of length $M$ is the $\lceil \dfrac{M}{2} \rceil$ smallest element. For example the median of $[2, 4, 3, 1]$ is $
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.
Sign in to chat with the tutor and save your progress.
Sign in to start