Skip to main content

Practice · 5 of 5

Debug the recursive echo

CHALLENGE
Difficulty: beginner+25 XP

puzzle(n) should build "5 3 1 1 3 5"-style strings: descend printing n, n−2, ..., then unwind printing them all again. The current version only descends — the after-the-call half is missing. Fix it (must stay recursive with code on both sides of the call).

Back to lesson: Practice: Recursion reps