Stack With Increment Operation
Design a stack with maximum size. Commands: push x (ignored when full), pop (print the value or -1), increment k v (add v to the bottom k elements). Print the result of every pop.
Constraints
1 <= maxSize <= 1000
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.