← All problemsSign in

Game of Towers

Alice and Bob love to play games with LEGO. In particular, there are $N$ buildings made up of $1\times 1$ blocks. The $i^{th}$ building is made up of $n_i$ number of towers, each tower is just a stack of $1\times 1$ blocks. All the buildings have a similar shape, i.e., for the $i^{th}$ building, the first tower has a height $h_i$, second has a height $h_i+1$, ... $n_i^{th}$ tower has height $h_i+n

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