Easy python solution
\nclass RLEIterator:\n\n    def __init__(self, encoding: List[int]):\n        self.lst=encoding\n\n    def next(self, n: int) -> int:\n        num=-1\n        w
```\nclass RLEIterator:\n\n    def __init__(self, encoding: List[int]):\n        self.lst=encoding\n\n    def next(self, n: int) -> int:\n        num=-1\n        while self.lst and n>0:\n            if n<=self.lst[0]:\n                self.lst[0]-=n  \n                n=0\n                num=self.lst[1]\n            else:\n                n-=self.lst[0]\n                self.lst[0]=0\n            if self.lst[0]==0:\n                self.lst.pop(0)\n                self.lst.pop(0)\n        if n>0:\n            return -1\n        return num\n```
['Python', 'Python3']