Ozioma Ogbe
12/19/2024, 9:39 AMDan Fingal-Surma
12/19/2024, 7:10 PMMutableMap.getOrPut
, and data classes make this so easy to implement it doesn't really seem necessary.
The first time I encountered such a problem I looked for the equivalent of functools.lru_cache
but was satisfied with what the stdlib already provides.
That and, while I've used caches (primarily the Guava cache library) plenty of times while professionally programming, pure unbounded memorization just doesn't really come up outside of challenge problems.