You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Asked at 20 companies
AdobeAlibabaAmazon
Hints
1.Think about what data structure fits Climbing Stairs
2.Consider the brute force complexity and how to optimize