C++ || I learned and then wrote
\n# Code\n\nclass SnapshotArray {\npublic:\n  int snapId;\n  vector<vector<pair<int,int>>>history;\n    SnapshotArray(int length) {\n        history.resize(leng
\n# Code\n```\nclass SnapshotArray {\npublic:\n  int snapId;\n  vector<vector<pair<int,int>>>history;\n    SnapshotArray(int length) {\n        history.resize(length);\n        snapId=0;\n        for(int i=0;i<length;i++){\n            history[i].push_back({0,0});\n        }\n    }\n    \n    void set(int index, int val) {\n        history[index].push_back({snapId,val});\n    }\n    \n    int snap() {\n       return snapId++;\n    }\n    \n    int get(int index, int snap_id) {\n        auto it=upper_bound(history[index].begin(),history[index].end(),make_pair(snap_id,INT_MAX));\n        return prev(it)->second;\n    }\n};\n\n/**\n * Your SnapshotArray object will be instantiated and called as such:\n * SnapshotArray* obj = new SnapshotArray(length);\n * obj->set(index,val);\n * int param_2 = obj->snap();\n * int param_3 = obj->get(index,snap_id);\n */\n```
['Array', 'Hash Table', 'Binary Search', 'Design', 'C++']