← All problemsSign in

The Lego Way

Have you ever heard of the great lego way? Neither have we. But anyways we have to reconstruct the ancient broken lego way, the lego way is made of blocks of dimensions 1x1, but it used to be a magnificent structure going upwards like stairs, i.e each pillar in this lego way was one higher than the one before it. If it is represented as an array $Arr[i] = 1 + Arr[i-1]$. You are given 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