leetcode 1860. Incremental Memory Leak(python)

NoSuchKey