Median
CodeChefOpen on judge ↗
There is a set consist of elements in form of number, the median is an element N such that the number of elements greater than N is equal to the number of elements smaller than N. For example, in a set {1, 5, 2, 6, 7} the median is 5 because two elements (6 and 7) are greater than 5 and 2 elements (1 and 2) smaller than 5. The set {1, 5, 8, 3} has no median because no element from it satisfies 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.
Sign in to chat with the tutor and save your progress.
Sign in to start