The author incorrectly states that the k-th Fibonacci number can be computed in O(1) time. Actually the algorithm he describes runs in O(k) time.
return fibonacci[k]
This is the canonical benefit of memoization, further clarified by this quote: "This solution has an O(k) space and time complexity for the first query."I mean they would be able to deduce it, but they just never made the connection.