← All problemsSign in

Utkarsh and Long Roads

Problem Description Utkarsh is on his way to Q shrines on the X axis. The ith Shrine is present at X=Li. For each shrine, Utkarsh will start at X=0 and move forward with the help of an array A of size N which will help him to reach the shrines. To move forward he must choose an index 1 which allows him to jump A[i] units forward in the positive X axis. Utkarsh hates forgetting the past so he has

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