The problem involves designing a stack with a custom increment operation. The stack should support basic stack operations like push and pop, and an additional increment operation that increments the bottom elements of the stack by a given value.
Implement a stack with the following operations:
push(int x): Push element x onto stack.pop(): Removes the element on top of the stack and returns it.increment(int k, int val): Increments the bottom k elements of the stack by val.int[] ops: An array of operations where each operation is either "PUSH x", "POP", or "INCREMENT k val".int k and int val: Parameters for the increment operation.1 <= n <= 100 where n is the number of operations.-100 <= val <= 100.1 <= k <= n.1 <= x <= 100 for push operations.