C++ Super Simple and Short Solution
\nclass RLEIterator {\npublic:\n    RLEIterator(vector<int>& encoding) {\n        rle = encoding;\n        size = encoding.size();\n    }\n    \n    int next(in
```\nclass RLEIterator {\npublic:\n    RLEIterator(vector<int>& encoding) {\n        rle = encoding;\n        size = encoding.size();\n    }\n    \n    int next(int n) {\n        while (idx < size) {\n            \n            if (n <= rle[idx]) {\n                rle[idx] -= n;\n                return rle[idx+1];\n            }\n            \n            else {\n                n -= rle[idx];\n                idx += 2;\n            }\n        }\n        \n        return -1;\n    }\n    \nprivate:\n    vector<int> rle;\n    int idx = 0,size;\n};\n```\n**Like it? please upvote!**
['C']