This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
dp里求排列,1 2 步 和 2 1 步都是上三个台阶,但不一样!
这是求排列
```
class Solution {
public:
int climbStairs(int n) {
vector<int> dp(n + 1, 0);
dp[0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= 2; j++) {
if (i - j >= 0) dp[i] += dp[i - j];
}
return dp[n];
};