← All problemsSign in

FALLING RODS

Little Shreyanshi got bored of playing with her old toys in this lockdown. She decided to play a new game in which she keeps $N$ rods in standing position in a row. She randomly chooses some of these rods to be pushed to left or right initially. After each second, the rod falling on left pushes the adjacent standing rod to the left. Similarly, the rods falling to the right push their adjacent

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