[Python] Design an Ordered Stream
I just need help with the design , if it can be improved.\n\n\nclass OrderedStream:\n\n    def __init__(self, n: int):\n        self.n = n\n        self.dp = {i
I just need help with the design , if it can be improved.\n\n```\nclass OrderedStream:\n\n    def __init__(self, n: int):\n        self.n = n\n        self.dp = {i:[] for i in range(1,self.n+1)}\n        self.i = 1\n\n    def insert(self, idKey: int, value: str) -> List[str]:\n        (self.dp[idKey]).insert(0,value)\n        ss= []\n        if len(self.dp[self.i]) == 0:\n            return []\n        while self.i<= self.n and len(self.dp[self.i]) != 0 :\n            ss+=(self.dp[self.i])\n            self.i += 1\n        return ss\n\n```
[]