C++ faster than 99.33%, memory usage less than 97.76%
\nclass OrderedStream {\n    public:\n        // Initialize "pointer" (btw not an actual pointer) & stream vector\n        int ptr=0;\n        vector<string> st
```\nclass OrderedStream {\n    public:\n        // Initialize "pointer" (btw not an actual pointer) & stream vector\n        int ptr=0;\n        vector<string> stream;\n\n        OrderedStream(int n) {\n            // Constructor makes stream vector of size n\n            vector<string> strm(n);\n            stream = strm;\n        }\n\n        vector<string> insert(int id, string value) {\n            // decrease id by one to correspond with vector idx (i.e. start from 0)\n            --id;\n            \n\t\t\t// create a vector to be returned by function\n            vector<string> returnVec;\n            \n\t\t\t// at index id in stream vector, set the value\n            stream[id] = value;\n            \n            // if stream at index ptr is not empty...\n            if (stream[ptr] != "") {\n                \n\t\t\t\t// create a new int to mark the start index\n                int start_idx = ptr;\n                \n\t\t\t\t// while stream at index ptr is not empty, move ptr to the next index\n                while (stream[ptr] != "" && ptr != stream.size()) ptr++;\n                \n\t\t\t\t// set returnVec to a sliced version of the stream vector\n                // (i.e. stream[start_idx:ptr])\n                returnVec = vector<string>(stream.begin()+start_idx, stream.begin()+ptr);\n            }\n            return returnVec;\n        }\n}; \n\n```\n\nJust my first go at it, im sure it could be improved. Welcome to any suggestions.
['C']