Explaining Leetcode -

Опубликовано: 12 Февраль 2026
на канале: JTECH
563
7

In this video I explain the algorithm behind solving Leetcode problem 1381 Design a Stack With Increment Operation. We fill a method for determining the maximum stack size. We also create methods to push and pull from the stack with a constant number of operations regardless of the stack size O(1), and finally find a way to increment values in the stack O(k).
I am coding in Java since its syntax is easy to understand by all programmers. The algorithms can be applied easily in other languages and most functions that I use have a counterpart in your language of choice.

0:00 Introduction and explaining the stack concept
1:43 Implementing stack with arrays
2:47 maxSize
3:44 push and pull methods
9:52 increment