C++, Unordered Map without binary search, TLE
Get function time complexity  is O(1), but still it\'s giving TLE for one test case.\n   \n    int totalSnaps;\n    unordered_map> unmap;\n    vector cur_arr;\n
Get function time complexity  is O(1), but still it\'s giving TLE for one test case.\n   \n    int totalSnaps;\n    unordered_map<int, vector<int>> unmap;\n    vector<int> cur_arr;\n    \n    SnapshotArray(int length) {\n        cur_arr = vector<int>(length,0);\n        totalSnaps = 0;\n    }\n    \n    void set(int index, int val) {\n        cur_arr[index] = val;\n    }\n    \n    int snap() {\n        unmap[totalSnaps] = cur_arr;\n        int id = totalSnaps;\n        totalSnaps += 1;\n        return id;\n    }\n    \n    int get(int index, int snap_id) {\n        if(unmap.find(snap_id) != unmap.end()){\n            return unmap[snap_id][index];\n        }\n        return 0;\n     }\n\t \n\t \nEdit:  https://stackoverflow.com/questions/56097653/what-is-the-time-complexity-of-mapping-a-vector\nFound the issue, Copying vector complexity is O(N). That\'s why snap operation complexity is O(N).
['C']