3 ms·
Another cool Python DP hack is using @functools.lru_cache to perform the memoization (beware of the maxsize parameter though).
by sannee 8y ago
Another cool Python DP hack is using @functools.lru_cache to perform the memoization (beware of the maxsize parameter though).