C++ || Binary search || Hashmap || Clean & Concise
\n  map< int , map< int , int >> mp;\n    \n    int count=0;\n    \n    SnapshotArray(int length) {\n        \n    }\n    \n    void set(int index, int val) {\n
```\n  map< int , map< int , int >> mp;\n    \n    int count=0;\n    \n    SnapshotArray(int length) {\n        \n    }\n    \n    void set(int index, int val) {\n        \n        mp[index][count]=val;\n        \n    }\n    \n    int snap() {\n        \n        count++;\n        \n        return count-1;\n        \n    }\n    \n    int get(int index, int snap_id) {\n        \n        auto it = mp[index].lower_bound(snap_id+1);\n        \n        int v=0;\n        \n        if(it!=mp[index].begin())\n        {\n            it--;\n            v = it->second;\n        }\n        \n        return v;\n        \n    }\n```
['C', 'Binary Tree', 'C++']