maxSize.push, add the element to the top if the current size is less than maxSize.pop, return the top element and decrease the size, or return -1 if the stack is empty.increment, iterate through the bottom k elements or the entire stack if k is greater than the current size, and add val to each element.