lru_cache() is one functionin functools module which
helps in reducing the execution time of the function
by using memoization technique.
Syntax:
@lru_cache(maxsize=128, typed=False)
Parameters:
maxsize:
This parameter sets the size of the cache,
the cache can store upto maxsize most recent function calls,
if maxsize is set to None,
the LRU feature will be disabled
and the cache can grow without any limitations
typed:
If typed is set to True, function arguments of different types will be cached separately.
For example,
f(3) and f(3.0) will be treated as distinct calls with distinct results
and they will be stored in two separate entries in the cache