CodeMentor.
Ask AIProblemsLearnC++TCSCore CSHRProgress
0Lv 1
ProblemsIntro Dynamic Programming

Climbing Stairs

Easy
LeetCode
1/3
EasyIntro Dynamic ProgrammingLeetCode #70

Climbing Stairs

Ways(n) = ways(n-1)+ways(n-2). Fibonacci in disguise.

Examples

Example 1

Input

2

Output

2
Example 2

Input

3

Output

3

Stuck? Take a nudge

C++17Autosaves