[Java] Simple Iteration O(1) space
```\nclass RLEIterator {\n    \n    private final int[] encoding;\n    private final int size;\n        \n    int encodeIndex = 0;\n\n    public RLEIterator(int
```\nclass RLEIterator {\n    \n    private final int[] encoding;\n    private final int size;\n        \n    int encodeIndex = 0;\n\n    public RLEIterator(int[] encoding) {\n        this.encoding = encoding;\n        this.size = encoding.length;\n    }\n    \n    public int next(int n) {\n        \n        while (encodeIndex < size) {\n            if (encoding[encodeIndex] <= n) {\n                if (encoding[encodeIndex] != 0) n -= encoding[encodeIndex];\n                encodeIndex+=2;\n                if (n == 0) return encoding[encodeIndex - 1];\n            } else {\n                encoding[encodeIndex] -= n;\n                return encoding[encodeIndex + 1];\n            }\n        }\n    \n        return -1;\n    }\n}\n\n/**\n * Your RLEIterator object will be instantiated and called as such:\n * RLEIterator obj = new RLEIterator(encoding);\n * int param_1 = obj.next(n);\n */
[]