| 2 | using namespace std; |
| 3 | |
| 4 | class Solution { |
| 5 | public: |
| 6 | long long int nthFibonacci(long long int n){ |
| 7 | // code here |
| 8 | |
| 9 | // Base Case |
| 10 | if (n == 0) { |
| 11 | return 0; |
| 12 | } |
| 13 | |
| 14 | if (n == 1){ |
| 15 | return 1; |
| 16 | } |
| 17 | |
| 18 | // Recursive Call |
| 19 | long long int recCall1 = nthFibonacci(n-1); |
| 20 | long long int recCall2 = nthFibonacci(n-2); |
| 21 | |
| 22 | // Small Calculation |
| 23 | long long int smallCal = recCall1 + recCall2; |
| 24 | |
| 25 | return smallCal; |
| 26 | |
| 27 | } |
| 28 | }; |
| 29 | |
| 30 | int main() { |
| 31 | int t; |
nothing calls this directly
no outgoing calls
no test coverage detected