[Python] Hash Map 352ms 100%
\nclass SnapshotArray:\n\n    def __init__(self, length: int):\n        self.d = {}\n        self.snap_d = {}\n        self.snap_times = -1\n        \n\n    def
```\nclass SnapshotArray:\n\n    def __init__(self, length: int):\n        self.d = {}\n        self.snap_d = {}\n        self.snap_times = -1\n        \n\n    def set(self, index: int, val: int) -> None:\n        self.d[index] = val\n\n    def snap(self) -> int:\n        self.snap_times += 1\n        self.snap_d[self.snap_times] = self.d.copy()\n        return self.snap_times\n        \n\n    def get(self, index: int, snap_id: int) -> int:\n        if snap_id in self.snap_d:\n            d_at_snap = self.snap_d[snap_id]\n            if index in d_at_snap:\n                return d_at_snap[index]\n        return 0\n```
['Python', 'Python3']