python beats 100%
python\nclass RLEIterator(object):\n\n    def __init__(self, A):\n        """\n        :type A: List[int]\n        """\n        self.index = []\n        self.da
```python\nclass RLEIterator(object):\n\n    def __init__(self, A):\n        """\n        :type A: List[int]\n        """\n        self.index = []\n        self.data = []\n        for i,r in enumerate(A):\n            if i % 2 == 0 and r > 0 :\n                self.index.append(r)\n                self.data.append(A[i+1])\n        self.dlen = sum(self.index)\n        \n\n    def next(self, n):\n        """\n        :type n: int\n        :rtype: int\n        """\n        if n > self.dlen:\n            self.data = []\n            self.index = []\n            self.dlen = 0\n            return -1\n        else:\n            for i,no in enumerate(self.index):\n                if no < n:\n                    self.dlen -= no\n                    n -= no\n                else:\n                    self.dlen -= n\n                    self.index[i] -= n\n                    break\n            \n            self.data = self.data[i:]\n            self.index = self.index[i:]\n            return self.data[0]\n```
[]