C++ God Solution
Map STL\n\nclass OrderedStream {\npublic:\n    map<int,string> mp;\n    int maxSize = -1,currIndex = 1;\n    \n    OrderedStream(int n) {\n        maxSize = n;\
**Map STL**\n```\nclass OrderedStream {\npublic:\n    map<int,string> mp;\n    int maxSize = -1,currIndex = 1;\n    \n    OrderedStream(int n) {\n        maxSize = n;\n        for(int i=1;i<=n;i++) mp[i] = "----";\n    }\n    \n    vector<string> insert(int idKey, string value) {\n        vector<string> res;\n        mp[idKey] = value;\n        int i =1;\n        for(int i=currIndex;i<=maxSize;i++){\n            if(mp[i] != "----"){\n                res.push_back(mp[i]);\n            }else{\n                currIndex = i;\n                break;\n            }\n        }\n        \n        return res;\n    }\n};\n\n/**\n * Your OrderedStream object will be instantiated and called as such:\n * OrderedStream* obj = new OrderedStream(n);\n * vector<string> param_1 = obj->insert(idKey,value);\n */\n```\n<br>\n<div> Happy coding </div>\nPlease do upvote this post.\n\n![image](https://assets.leetcode.com/users/images/5ce11bf6-0db9-4239-bbb9-dfe5d76443f3_1666346629.9681695.gif)
['Array', 'C', 'C++']