MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / fib

Function fib

fibonacci_number_509/solution.go:3–9  ·  view source on GitHub ↗
(N int)

Source from the content-addressed store, hash-verified

1package fibonacci_number_509
2
3func fib(N int) int {
4 if N < 2 {
5 return N
6 }
7
8 return fib(N-1) + fib(N-2)
9}

Callers 1

Test_fibFunction · 0.85

Calls

no outgoing calls

Tested by 1

Test_fibFunction · 0.68