C++ Solution | Bloomberg High Frequency Problem
This is the Bloomberg High Frequency Problem. They asked the same question wrapping it as printing package of a UDP process. \n\n\nclass OrderedStream {\nprivat
This is the Bloomberg High Frequency Problem. They asked the same question wrapping it as printing package of a UDP process. \n\n```\nclass OrderedStream {\nprivate:\n    int id = 1; \n    \n    unordered_map<int, string> m;\npublic:\n    OrderedStream(int n) {\n        \n    }\n    \n    vector<string> insert(int idKey, string value) {\n        m[idKey] = value; vector<string> res;\n        \n        while (m.find(id) != m.end()) {\n            res.emplace_back(m[id]); id++;\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```
['C']