C++ Self Explainatory
\nclass OrderedStream {\npublic:\n    \n    vector<string>res;\n    int ptr;\n    OrderedStream(int n) {\n        res.resize(n);\n        ptr = 1;\n    }\n    \
```\nclass OrderedStream {\npublic:\n    \n    vector<string>res;\n    int ptr;\n    OrderedStream(int n) {\n        res.resize(n);\n        ptr = 1;\n    }\n    \n    vector<string> insert(int id, string value) {\n        res[id-1] = value;\n        vector<string> ans;\n        \n        if(ptr == id) {\n            int i = ptr - 1;\n            \n            for(; i < res.size(); i++) {\n                if(res[i] == "")\n                    break;\n                ans.push_back(res[i]);\n            }\n            ptr = i+1;\n        }\n        return ans;\n    }\n};\n```
['C', 'C++']