← All problemsSign in

The Two Towers

Ajeyaa and Sriram are experimenting with a block simulator. The simulator generates a tower of $N$ blocks. Each block in the tower has a unique value assigned to it. Both of them decide to rearrange the tower to make it look aesthetically more pleasing, with each having thought of a different way of doing it. Ajeyaa wants to arrange them such that the block values are in ascending order from top t

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