Code RoomTrail marker reachability
EasyPrep Room Coding #694

Trail marker reachability

CodingAlgorithms & data structuresEntry–Mid~12 min

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.

0:00 of about 12 min
InputExpectedGot
[[2,3,1,1,4]]truenot run yetsample
[[3,2,1,0,4]]falsenot run yetsample