Easy Python with Binary Search
\nclass RLEIterator:\n\n    def __init__(self, A):\n        """\n        :type A: List[int]\n        """\n        self.rle = []\n        self.times = [A[0]] \n 
```\nclass RLEIterator:\n\n    def __init__(self, A):\n        """\n        :type A: List[int]\n        """\n        self.rle = []\n        self.times = [A[0]] \n        self.ptr = 0\n        for i in range(1,len(A),2):\n            if A[i-1]:\n                self.rle.append(A[i])\n        for i in range(2, len(A), 2):\n            if A[i]:\n                self.times.append(self.times[-1] + A[i])\n\n    def next(self, n):\n        """\n        :type n: int\n        :rtype: int\n        """\n        self.ptr += n\n        if self.ptr > self.times[-1]:\n            return -1\n        idx = bisect.bisect_left(self.times, self.ptr)\n        return self.rle[idx]\n        \n\n```\n\nCondensed Version\n\n```\nclass RLEIterator:\n\n    def __init__(self, A):\n        """\n        :type A: List[int]\n        """\n        self.rle = []\n        self.ptr = cnt = 0\n        for i, j in zip(A[::2], A[1::2]):\n            if i != 0:\n                cnt += i  \n                self.rle.append((cnt, j)) \n    def next(self, n):\n        """\n        :type n: int\n        :rtype: int\n        """\n        self.ptr += n\n        if self.ptr > self.rle[-1][0]:\n            return -1\n        target = bisect.bisect_left(self.rle, (self.ptr,))\n        return self.rle[target][1] \n```
[]