Normal is Good (Easy)
**This is the easy version of the problem. The only difference is the constraint on $A_i$ — in this version, $1 \leq A_i \leq 2$.** An array $B$ of length $M$ is said to *normal* if its mean equals its median. The mean of $B$ is defined to be $$ \frac{B_1 + B_2 + \ldots + B_M}{M} $$ For example, the mean of $[1, 2]$ is $\frac{3}{2} = 1.5$, and the mean of $[2, 2, 3, 1, 3]$ is $\frac{11}{5} = 2
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