Code Room
CodingEasycod-g1439
Subject GreedyLevel Entry–Mid~12 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Stepping stones cross a creek, numbered 0 to n-1 from the near bank. hops[i] is the farthest number of stones you can leap forward from stone i (0 means that stone is a dead end). You start on stone 0. Return True if you can reach the last stone. Example: hops [2, 1, 0, 1] is False — every route strands you on stone 2.

Implement
can_cross(hops: list[int]) → bool
Examples
in[[2,1,0,1]]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.