← All problemsSign in

parity Sum

For a positive integer $M$, MoEngage defines **digitSum(M)** as the sum of digits of the number $M$ (when written in decimal). For example, **digitSum(1023)** = 1 + 0 + 2 + 3 = 6. Given a positive integer $N$, find the smallest integer XX strictly greater than NN such that: **digitSum(N)** and **digitSum(X)** have different parity, i.e. one of them is odd and the other is even. ### Input - 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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start