Code Room
CodingEasy
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]) → boolExamples
in
[[2,1,0,1]]outfalseWhat 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.
Learn the concepts
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.