A neat trick in Java for building an LRU cache is to override the
removeEldestEntry from a LinkedHashMap such as:…461451e
removeEldestEntry from a LinkedHashMap such as:…Counter from python. For example, we can easily count the characters in a word:
word = "banana"
counts = Counter(word)
print(counts)
# Counter({'a': 3, 'n': 2, 'b': 1})commit 461451e