MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / climbStairs

Method climbStairs

70. Climbing Stairs/Solution.cpp:14–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12class Solution {
13public:
14 int climbStairs(int n) {
15 vector <int> fib (n+1, 1);
16 for (int i=2; i<=n;i++) {
17 fib[i] = fib[i-1] + fib[i-2];
18 }
19 // for (int i: fib) cout << i;
20 return fib[n];
21 }
22};
23
24int main() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected