Problem 1381 · Medium

Design a Stack With Increment Operation

Store a lazy add beside each stack slot so an increment touches one entry, and pass it down on pop.

Open the interactive visualisation