/** * @param{number[]} A */varRLEIterator=function(A) {this.A=A;this.current =0;};/** * @param{number} n * @return{number} */RLEIterator.prototype.next=function(n) {constA=this.A;while(this.current <A.length&&A[this.current] < n){ n = n -A[this.current];this.current +=2; }if(this.current >=A.length){return-1; }A[this.current] =A[this.current] - n; // 更新CountreturnA[this.current +1]; // 返回element};/** * Your RLEIterator object will be instantiated and called as such: * var obj = new RLEIterator(A) * var param_1 = obj.next(n) */