@lc app=leetcode id=70 lang=cpp * * [70] Climbing Stairs */ class Solution { public: int climbStairs(int n) { /* * Runtime: 0 ms, faster than 100.00% of C++ ... ... <看更多>
Search
Search
@lc app=leetcode id=70 lang=cpp * * [70] Climbing Stairs */ class Solution { public: int climbStairs(int n) { /* * Runtime: 0 ms, faster than 100.00% of C++ ... ... <看更多>
Methodology · Find the base case. When climb 1 stair, we need 1 step · Find the pattern: To reach the current stairs for example (stair 4), we can ... ... <看更多>
I tried to separate the climbing scenarios into scenarios of how many 2 steps can be taken and to solve the question according to the sum of the ... ... <看更多>