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

Question

In a platformer game, your character climbs a tower of n ledges starting from the ground (ledge 0). Each dash move ascends exactly 1, 2, or 3 ledges. Return the number of distinct sequences of dash moves that land the character exactly on ledge n. If n is 0 the character is already at the top, so return 1. For example, n = 3 has 4 sequences: 1+1+1, 1+2, 2+1, and 3.

Implement
count_dash_routes(n: int) → int
Examples
in[3]out4
in[5]out13
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.