Memoization

Memoization is a design pattern in which the result of a function’s execution is cached, and the cached result is returned when the function is subsequently called with identical inputs, thus avoiding redundant computation.

Memoization is a form of caching, but it is specifically used to optimize the performance of functions that are computationally expensive or time-consuming.