120ms | Go solution
\n\ntype OrderedStream struct {\n  hm map[int]string\n  n int\n  posPtr int  \n}\n\nfunc Constructor(n int) OrderedStream {\n  return OrderedStream {\n    hm: m
\n```\ntype OrderedStream struct {\n  hm map[int]string\n  n int\n  posPtr int  \n}\n\nfunc Constructor(n int) OrderedStream {\n  return OrderedStream {\n    hm: make(map[int]string),\n    n: n,\n    posPtr: 1,\n  }\n}\n\n\nfunc (this *OrderedStream) Insert(idKey int, value string) []string {\n  this.hm[idKey] = value\n\n  ans := []string{}\n  for this.posPtr <= this.n && this.hm[this.posPtr] != "" {\n    ans = append(ans, this.hm[this.posPtr])\n    this.posPtr++\n  }\n\n  return ans\n}\n```
['Go']