Why does the time exceed after 40 in dynamic programming solution compared to iterative? Any idea?

```
public class Solution {
public int climbStairs(int n) {
if(n==0){
return 0;
}
if(n==1){
return 1;
}
if(n==2){
return 2;
}
return (climbStairs(n-1)+climbStairs(n-2));
}
}
```