← All problemsSign in

Land of the Shire

The land of The Shire is separated from Rivendell by a long hanging bridge. When viewed from the side, the bridge seems to be an endless array of planks. The planks of the array are numbered from left to right with integers, starting with 1. The elves from Rivendell are playing a game. At the beginning of the game the i-th elf is above the plank number hi. Every elf can only take one step to the l

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