File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
- Given an set of numbers in a stack,
2
+ Given an set of numbers in a stack,
3
3
find the minimum value from the stack at O(1)
4
4
5
5
Problem: https://leetcode.com/problems/min-stack/description/
@@ -15,7 +15,7 @@ def push(value: int) -> None:
15
15
If the value to insert < minimum, then push to min stack
16
16
Returns None
17
17
18
- >>>
18
+ >>>
19
19
"""
20
20
if len (stack ) == 0 :
21
21
min_stack .append (value )
@@ -29,13 +29,13 @@ def push(value: int) -> None:
29
29
30
30
def pop () -> None :
31
31
"""
32
- Pop from the stack.
32
+ Pop from the stack.
33
33
If the popped value is the same as the min stack top,
34
34
pop from the min stack as well
35
35
36
36
Returns None
37
37
38
- >>>
38
+ >>>
39
39
"""
40
40
if len (stack ) == 0 :
41
41
print ("Nothing on stack" )
@@ -48,7 +48,7 @@ def pop() -> None:
48
48
49
49
def get_min () -> int :
50
50
"""
51
- Return the minimum element of the main stack by
51
+ Return the minimum element of the main stack by
52
52
returning the top of the minimum stack
53
53
54
54
Returns the minium element (int)
You can’t perform that action at this time.
0 commit comments