← All problemsSign in

Frequency Issue

Alice and Bob are very interested in arrays. Alice gave Bob an array of **N** integers and an integer **X** and asked him to perform some operations on them. For each A[i] *($1 \leq i \leq N$)*, the operations Bob can do are as follows: - Add X to A[i]. - Subtract X from A[i]. - Keep the element unchanged. The operation can be applied **only once** on each A[i]. After performing one of the abo

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