https://leetcode-cn.com/problems/design-a-stack-with-increment-operation/
[制卡]
class CustomStack {public arr: number[] = []public length: number = 0constructor(maxSize: number) {this.length = maxSize}push(x: number): void {if (this.arr.length < this.length) {this.arr.push(x)}}pop(): number {const item = this.arr.pop()return item === undefined ? -1 : item}increment(k: number, val: number): void {this.arr = this.arr.map((item,index) => index < k? item + val: item);}}
