Python 16ms (beats 100%)
\nclass RLEIterator(object):\n    def __init__(self, encoding):\n        """\n        :type encoding: List[int]\n        """\n        \n        self.arr = []\n 
```\nclass RLEIterator(object):\n    def __init__(self, encoding):\n        """\n        :type encoding: List[int]\n        """\n        \n        self.arr = []\n        for i in range(0, len(encoding), 2):\n            cnt = encoding[i]\n            x = encoding[i + 1]\n            if cnt > 0:\n                self.arr.append((x, cnt))\n        \n    def next(self, n):\n        """\n        :type n: int\n        :rtype: int\n        """\n        last = None\n        while len(self.arr) > 0:\n            x, cnt = self.arr[0]\n            last = x\n            diff = cnt - n\n            if diff <= 0:\n                n -= cnt\n                self.arr = self.arr[1:]\n                if diff == 0:\n                    break\n            else:\n                self.arr[0] = (x, cnt - n)\n                n = 0\n                break\n                \n        if n > 0:\n            return -1\n        return last\n```
[]