C# using array
Code\n\npublic class OrderedStream\n{\n    private readonly string?[] _data;\n    private int _ptr;\n\n    public OrderedStream(int n)\n    {\n        _data = n
# Code\n```\npublic class OrderedStream\n{\n    private readonly string?[] _data;\n    private int _ptr;\n\n    public OrderedStream(int n)\n    {\n        _data = new string[n + 1];\n        _ptr = 1;\n    }\n\n    public IList<string> Insert(int idKey, string value)\n    {\n        _data[idKey] = value;\n        var res = new List<string>();\n        for (var i = _ptr; i < _data.Length; i++)\n        {\n            if (_data[i] != null)\n            {\n                res.Add(_data[i]!);\n            }\n            else\n            {\n                _ptr = i;\n                break;\n            }\n        }\n\n        return res;\n    }\n}\n\n```
['C#']