← All problemsSign in

The Array

Maria has an array $A$ of size $S$ and she wants to find the sum of all the elements in the array. To add some difficulty to this task, she first takes an integer $N$ and subtracts it from each element $E$ of the array. If upon subtracting $N$ from $E$, the value is $ \lt 0$ then she considers that value to be $0$. You have to write a program that can display the total $T$ of all elements after pe

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