Code Room
CodingEasycod-g1490
Subject Dynamic programming 1dLevel Entry–Mid~12 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A hiking game shows a trail of markers. Standing on marker i, your stamina lets you advance to any marker from i+1 up to i+jumps[i]; a value of 0 means you are stuck there. You start on the first marker. Return true if the last marker can be reached, false otherwise. A single-marker trail is trivially finished. For example, [2, 3, 1, 1, 4] is finishable but [3, 2, 1, 0, 4] is not.

Implement
can_finish_trail(jumps: list[int]) → bool
Examples
in[[2,3,1,1,4]]outtrue
in[[3,2,1,0,4]]outfalse
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.