← All problemsSign in

Maintain Mean

Chef has an array $a$ of $n$ integers. Mathematic mean of array elements is $k$ (may or may not be an integer). Mathematic mean of an array of $n$ elements is the sum of elements divided by the number of elements ($n$). Chef wants to reduce the array by deleting exactly two elements from array such that mathematic mean of remaining $(n-2)$ elements is still equal to $k$. Your task is to find nu

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