C++ short and easy
\nclass OrderedStream {\npublic:\n    vector<string>v;\n    int i; //global index variable, to help us return output as vector gets filled\n    OrderedStream(in
```\nclass OrderedStream {\npublic:\n    vector<string>v;\n    int i; //global index variable, to help us return output as vector gets filled\n    OrderedStream(int n) {\n        v.resize(n, ""), i = 0;\n    }\n    vector<string> insert(int id, string value) {\n         v[id - 1] = value; //since id is starting from 1\n        vector<string>res;\n         while(i < v.size() and v[i].size() != 0)\n             res.push_back(v[i++]); //keep pushing the continuous values\n        return res;\n    }\n};\n```
['C++']