Slug: dp-climb-01 · Paired reading: Chapter 22
Prompt
fn climb_stairs(n: u32) -> u64 — ways to climb n steps taking 1 or 2 at a time.
O(n) time, O(1) extra space (rolling variables).
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? The landing page stays open — purchase unlocks this gym.
intermediate · order 139
Slug: dp-climb-01 · Paired reading: Chapter 22
fn climb_stairs(n: u32) -> u64 — ways to climb n steps taking 1 or 2 at a time.
O(n) time, O(1) extra space (rolling variables).