i am good at the computer boxes
Signed-off-by: Xe <me@christine.website>
This commit is contained in:
parent
c8430d6081
commit
47bd09bcd2
|
@ -40,10 +40,7 @@ func TestThunkFib(t *testing.T) {
|
||||||
|
|
||||||
var fib func(int) int
|
var fib func(int) int
|
||||||
fib = func(n int) int {
|
fib = func(n int) int {
|
||||||
if cache[n].o.IsSome() {
|
return cache[n-1].Force() + cache[n-2].Force()
|
||||||
return *cache[n].o.val
|
|
||||||
}
|
|
||||||
return fib(n-1) + fib(n-2)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range cache {
|
for i := range cache {
|
||||||
|
|
Loading…
Reference in New Issue