Pattern 22: LeetCode Interview Patterns24 sections · 736 units
Open in CourseQuiz: Staircase Recurrence
Test your understanding
Check Your Understanding
To reach step n, you can come from step n-1 (1 step) or step n-2 (2 steps). What is ways(n)?
- A.ways(n-1) × ways(n-2)
- B.2 × ways(n-1)
- C.max(ways(n-1), ways(n-2))
- D.ways(n-1) + ways(n-2)