def fibIterative(n, prevFib = 0, fib = 1) return n if n < 2 n.times do prevFib, fib = fib, prevFib + fib end prevFib end