EASY PYTHON SOLUTION USING BINARY SEARCH || 2-D ARRAY
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(nlogn)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n*n*2)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass SnapshotArray:\n    def bs(self,lt,rt,tr,lst):\n        ps=0\n        while lt<=rt:\n            mid=(lt+rt)//2\n            if lst[mid][1]<=tr:\n                ps=mid\n                lt=mid+1\n            else:\n                rt=mid-1\n        return ps\n\n\n    def __init__(self, length: int):\n        self.lst=[0]*length\n        self._id=0\n        self.nums=[[(0,0)] for _ in range(length)]\n        \n\n    def set(self, index: int, val: int) -> None:\n        self.lst[index]=val\n        if self.nums[index][-1][1]==self._id:\n            self.nums[index][-1]=(val,self._id)\n        elif self.nums[index][-1][1]<self._id:\n            self.nums[index].append((val,self._id))\n        \n\n    def snap(self) -> int:\n        x=self._id\n        self._id+=1\n        return x\n        \n\n    def get(self, index: int, snap_id: int) -> int:\n        x=self.bs(0,len(self.nums[index])-1,snap_id,self.nums[index])\n        return self.nums[index][x][0]\n\n        \n\n\n# Your SnapshotArray object will be instantiated and called as such:\n# obj = SnapshotArray(length)\n# obj.set(index,val)\n# param_2 = obj.snap()\n# param_3 = obj.get(index,snap_id)\n```
['Array', 'Binary Search', 'Python3']