C++ Array
cpp\nvector<string> s;\nint ptr = 1;\nOrderedStream(int n) : s(n + 1) {}\nvector<string> insert(int id, string value) {\n    s[id] = value;\n    vector<string> 
```cpp\nvector<string> s;\nint ptr = 1;\nOrderedStream(int n) : s(n + 1) {}\nvector<string> insert(int id, string value) {\n    s[id] = value;\n    vector<string> res;\n    while (ptr < s.size() && !s[ptr].empty())\n        res.push_back(s[ptr++]);\n    return res;\n}\n```
[]