Python Binary Search
self.id_map[index][0] records at which snap_id the change is made to the index\nself.id_map[index][1] records the corresponding value set\n\nclass SnapshotArray
self.id_map[index][0] records at which snap_id the change is made to the index\nself.id_map[index][1] records the corresponding value set\n```\nclass SnapshotArray:\n\n    def __init__(self, length: int):\n        self.id_map = [[[-1],[0]] for i in range(length)]\n        self.snap_id = -1\n\n    def set(self, index: int, val: int) -> None:\n        self.id_map[index][0] += [self.snap_id]\n        self.id_map[index][1] += [val]\n\n    def snap(self) -> int:\n        self.snap_id += 1\n        return self.snap_id\n\n    def get(self, index: int, snap_id: int) -> int:\n        loc = bisect.bisect_left(self.id_map[index][0],snap_id,0,len(self.id_map[index][0]))\n        return self.id_map[index][1][loc-1]\n```
[]