← All problemsSign in

Ansh and his love for Zeros

Ansh likes the number $0$. So he gives his friend Dhruvik a puzzle to solve. He gives him a string $A_0$ of length $L$, which has all zeros (if $N=4$, A = "$0000$"). He then gives him a list of $R$ changes, which changes the string.The $j-th$ change in the list changes the string $A$$j-1$ to $A_j$, so at the end of the list (that is, after $R$ changes) the string we get is $A_R$. Every change c

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