Dynamic Programming21 sections · 916 units
Open in Course

LeetCode 70 Climbing Stairs - Problem Statement

LC 70 Fibonacci disguise

Let me introduce you to LeetCode 7070, Climbing Stairs. You're climbing a staircase with nn steps. Each time you can climb 11 or 22 steps. How many distinct ways can you reach the top? Feel free to read the problem, think about it a little bit, and then move on to the next unit!

For n=4n = 4: you can take 1+1+1+11+1+1+1, 1+1+21+1+2, 1+2+11+2+1, 2+1+12+1+1, or 2+22+2 steps. That is 55 distinct ways to reach the top.