[C++/Python] vector based hashmap & global tracking index
[C++/Python] vector based hashmap & global tracking index\n\nApproach 1: vector based hashmap + global tracking index (C++ version)\n\nclass OrderedStream { // 
[C++/Python] vector based hashmap & global tracking index\n\nApproach 1: vector based hashmap + global tracking index (C++ version)\n```\nclass OrderedStream { // BEST: use global index to track order 1~n\npublic:\n    OrderedStream(int n):_vs(n+1), _idx(1) { }\n    \n    vector<string> insert(int idKey, string value) {\n        _vs[idKey]=value;\n        vector<string> ans;\n        while(_idx< _vs.size() && !_vs[_idx].empty())\n            ans.push_back(_vs[_idx++]);\n        return ans;\n    }\nprivate:\n    vector<string> _vs;\n    int _idx;\n};\n```\n\nApproach 1: Python\n```\nclass OrderedStream:\n\n    def __init__(self, n: int):\n        self._vs = [None]*(n+1)\n        self._ptr = 1\n\n    def insert(self, idKey: int, value: str) -> List[str]:\n        self._vs[idKey] = value\n        ans = []\n        while self._ptr < len(self._vs) and _vs[self._ptr]:\n            ans.append(_vs[self._ptr])\n            self._ptr+=1\n            \n        return ans\n```
['C', 'Python']