Python: holding last min index
\nclass OrderedStream(object):\n\n    def __init__(self, n):\n        """\n        :type n: int\n        """\n        self.values = [None] * n\n        self.ret
```\nclass OrderedStream(object):\n\n    def __init__(self, n):\n        """\n        :type n: int\n        """\n        self.values = [None] * n\n        self.returned_min = 0\n        \n\n    def insert(self, idKey, value):\n        """\n        :type idKey: int\n        :type value: str\n        :rtype: List[str]\n        """\n        self.values[idKey-1] = value\n        \n        ret = []\n\t\t# Value not None and index in boundary of values array size\n        while self.returned_min < len(self.values) and self.values[self.returned_min]:\n            ret.append(self.values[self.returned_min])\n\t\t\t# Holding last min index returned\n            self.returned_min += 1\n        \n        return ret\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```\n\nThe idea is that None value holes are skipped until filled, min boundary of the last returned non-None value is kept in `returned_min`  variable
['Python']