(n: i32)
| 6 | |
| 7 | impl Solution { |
| 8 | pub fn fib(n: i32) -> i32 { |
| 9 | if n == 0 { |
| 10 | 0 |
| 11 | } else if n == 1 { |
| 12 | 1 |
| 13 | } else { |
| 14 | Self::fib(n-1) + Self::fib(n-2) |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | pub fn fib_dp(n: i32) -> i32 { |
| 19 | let mut dp = vec![0; 31]; |
nothing calls this directly
no outgoing calls
no test coverage detected