4 ms·
Because the three liner is easier to read
by exdsq 6y ago
Because the three liner is easier to read
- eru 6y agoBtw, which three-liner do you mean?
- deleted 6y ago[deleted]
- exdsq 6y agofib 0 = 0 fib 1 = 1 fib n = fib (n-1) + fib (n-2)
- eru 6y agoOh, that version takes exponential time to compute. The one-liner I gave computes up to the n-th Fibonacci number in linear time.