Since the base cases n=0 and n=1 are already handled by the early if statements, the function only reaches the lower array logic when n >= 2. By using f[n-2], we map the values efficiently without wasting the first two array slots. As the array f[] is explicitly given in the question, our goal is to use it to store and reuse calculated values, which is the exact definition of Memoization (a Top-Down Dynamic Programming approach). This simple array check completely reduces the execution time from a slow exponential (O(2^n)) down to an optimal linear (Theta(n))