Bad description (C++ : solved using animation in example)
\nclass OrderedStream {\npublic:\n    vector<string> vec;\n    int n, pointer;\n    OrderedStream(int n) {\n        vec.resize(n+1, "");\n        this->n       
```\nclass OrderedStream {\npublic:\n    vector<string> vec;\n    int n, pointer;\n    OrderedStream(int n) {\n        vec.resize(n+1, "");\n        this->n       = n;\n        this->pointer = 1;\n    }\n    \n    vector<string> insert(int idKey, string value) {\n        vector<string> result;\n        vec[idKey] = value;\n        if(idKey == pointer) {\n            while(pointer <= n && vec[pointer] != "") {\n                result.push_back(vec[pointer]);\n                pointer++;\n            }\n        }\n        \n        return result;\n    }\n};\n```
[]