2017-12-21 10:14:53 +01:00

5 lines
95 B
TypeScript

export function fib(n: i32): i32 {
if (n <= 1) return 1;
return fib(n - 1) + fib(n - 2);
}