c++ | Array | easy
\nclass OrderedStream {\npublic:\n    vector<string>v;\n    int id=1;\n    OrderedStream(int n) {\n        v=vector<string>(n+1,"");\n    }\n    \n    vector<st
```\nclass OrderedStream {\npublic:\n    vector<string>v;\n    int id=1;\n    OrderedStream(int n) {\n        v=vector<string>(n+1,"");\n    }\n    \n    vector<string> insert(int idKey, string value) {\n        v[idKey]=value;\n        vector<string> ans;\n        while(id<v.size() && v[id]!="")ans.push_back(v[id++]);\n        return ans;        \n    }\n};\n\n/**\n * Your OrderedStream object will be instantiated and called as such:\n * OrderedStream* obj = new OrderedStream(n);\n * vector<string> param_1 = obj->insert(idKey,value);\n */\n```
['Array', 'C']