Implement an LRU caching decorator with manual eviction using OrderedDict.
Constraints
Example
```python
cached_add = lru_memoize(2)(lambda a, b: a + b)
print(cached_add(1, 2)) # 3
print(cached_add(2, 3)) # 5
print(cached_add(1, 2)) # 3 (cached)
print(cached_add(3, 4)) # 7 (evicts (1,2))
print(cached_add(1, 2)) # 3 (recomputed)
cached_greet = lru_memoize(1)(lambda name, greeting="Hello": f"{greeting}, {name}!")
print(cached_greet("Alice")) # Hello, Alice!
print(cached_greet("Bob", "Hi")) # Hi, Bob!
print(cached_greet("Alice")) # Hello, Alice! (recomputed)
```
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints