Skip to content

Commit 013c454

Browse files
committed
Time: 20 ms (19.45%), Space: 6 MB (17.68%) - LeetHub
1 parent b127cba commit 013c454

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution {
2+
public:
3+
int fib(int n) {
4+
if(n == 0) return 0;
5+
if(n == 1) return 1;
6+
return fib(n-1) + fib(n-2);
7+
}
8+
};

0 commit comments

Comments
 (0)