SIMPLE C++ SOLUTION
\nclass OrderedStream {\npublic:\n    vector<string> s;\n    int ptr=1;\n    OrderedStream(int n) {\n        s.resize(n+1);\n    }\n    \n    vector<string> ins
```\nclass OrderedStream {\npublic:\n    vector<string> s;\n    int ptr=1;\n    OrderedStream(int n) {\n        s.resize(n+1);\n    }\n    \n    vector<string> insert(int idKey, string value) {\n        s[idKey]=value;\n        vector<string> res;\n        while(ptr<s.size() && !s[ptr].empty())\n            res.push_back(s[ptr++]);\n        return res;\n    }\n};\n```
['C']