Skip to content

Commit 3cdf7ce

Browse files
committed
Time: 16 ms (9.45%), Space: 40.2 MB (73.02%) - LeetHub
1 parent f12d908 commit 3cdf7ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)