Submission Detail

31 / 31 test cases passed.
Status:

Accepted

Runtime: 662 ms
Memory Usage: 16.8 MB
Submitted: 24 minutes ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

50
100
150
200
250
300
350
400
450
500
550
1
2
3
4
5
6
7
python
Runtime (ms)
Distribution (%)

50
100
150
200
250
300
350
400
450
500
550
2.5
5.0
Zoom area by dragging across this chart

Accepted Solutions Memory Distribution

17200
16600
16700
16800
16900
17000
17100
17300
17400
17500
17600
17700
17800
5
10
15
20
25
python
You are here!
Your memory usage beats 87.37 % of python submissions.
Memory (KB)
Distribution (%)

17200
16600
16700
16800
16900
17000
17100
17300
17400
17500
17600
17700
17800
10
20
Zoom area by dragging across this chart

Invite friends to challenge Min Stack


Submitted Code: 24 minutes ago

Language: python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class MinStack(object):
def __init__(self):
self.stack = []
def push(self, val):
"""
:type val: int
:rtype: None
"""
self.stack.insert(0,val)
def pop(self):
"""
:rtype: None
"""
self.stack.pop(0)
def top(self):
"""
:rtype: int
"""
if (self.stack == []):
return null
val = self.stack[0]
return val
def getMin(self):
"""
:rtype: int
"""
m_stack = list(self.stack)
m_stack.sort()
return m_stack[0]
# Your MinStack object will be instantiated and called as such:
# obj = MinStack()
# obj.push(val)
# obj.pop()
# param_3 = obj.top()
# param_4 = obj.getMin()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX