Java 3ms beats 100%, very clear code
\n/*\nRuntime: 3 ms, faster than 100.00% of Java online submissions for RLE Iterator.\nMemory Usage: 42 MB, less than 5.01% of Java online submissions for RLE I
```\n/*\nRuntime: 3 ms, faster than 100.00% of Java online submissions for RLE Iterator.\nMemory Usage: 42 MB, less than 5.01% of Java online submissions for RLE Iterator.\n*/\n\nclass RLEIterator {\n    \n    int[] arr;\n    int indexIntoArr;\n\n    public RLEIterator(int[] encoding) {\n        // even indices are: number of times\n        // odd indices are:  what integer value\n        \n        this.arr = encoding;\n        this.indexIntoArr = 0;\n    }\n    \n    public int next(int n) {\n        \n        // guard clause\n\t\tif (this.indexIntoArr >= this.arr.length) {\n            return -1;\n        }\n        \n        if (n < this.arr[this.indexIntoArr]) {\n            this.arr[this.indexIntoArr] -= n;\n            return this.arr[this.indexIntoArr + 1];\n        \n        } else if (n == this.arr[this.indexIntoArr]) {\n            int toReturn = this.arr[this.indexIntoArr + 1];\n            this.indexIntoArr += 2;\n            return toReturn;\n        \n        } else { // n > this.arr[this.indexIntoArr]\n            n -= this.arr[this.indexIntoArr];\n            this.indexIntoArr += 2;\n            return this.next(n);\n        }\n    }\n}\n```
[]