You are viewing a single comment's thread. Return to all comments →
php
function fibonacci($n, $result = [0,1]) { if (isset($result[$n])) { return $result[$n]; } $length = count($result); $result[] = $result[$length - 1] + $result[$length - 2]; return fibonacci($n, $result); }
Recursion: Fibonacci Numbers
You are viewing a single comment's thread. Return to all comments →
php