Python easy solution
\nclass OrderedStream:\n\n    def __init__(self, n: int):\n        self.arr = [-1] * (n + 1)\n        self.n = n\n        self.ptr = 1\n\n\n    def insert(self,
```\nclass OrderedStream:\n\n    def __init__(self, n: int):\n        self.arr = [-1] * (n + 1)\n        self.n = n\n        self.ptr = 1\n\n\n    def insert(self, idKey: int, value: str) -> List[str]:\n        ans = []\n        self.arr[idKey] = value\n        \n        while self.ptr <= self.n and self.arr[self.ptr] != -1:\n            ans.append(self.arr[self.ptr])\n            self.ptr += 1\n        \n        return ans\n        \n\n# Your OrderedStream object will be instantiated and called as such:\n# obj = OrderedStream(n)\n# param_1 = obj.insert(idKey,value)\n```
[]