Submission Detail

166 / 166 test cases passed.
Status:

Accepted

Runtime: 114 ms
Memory Usage: 14 MB
Submitted: 5 minutes ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

80
90
100
110
120
130
140
150
160
170
1
2
3
4
5
6
python
You are here!
Your runtime beats 21.79 % of python submissions.
Runtime (ms)
Distribution (%)

80
90
100
110
120
130
140
150
160
170
2
4
6
Zoom area by dragging across this chart

Accepted Solutions Memory Distribution

13600
13700
13800
13900
14000
14100
14200
14300
14400
14500
5
10
15
20
python
You are here!
Your memory usage beats 72.36 % of python submissions.
Memory (KB)
Distribution (%)

13600
13700
13800
13900
14000
14100
14200
14300
14400
14500
5
10
15
20
Zoom area by dragging across this chart

Invite friends to challenge Set Matrix Zeroes


Submitted Code: 5 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
class Solution(object):
def setZeroes(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: None Do not return anything, modify matrix in-place instead.
"""
m = len(matrix) # num of rows
n = len(matrix[0]) # num of cols
rows = []
cols = []
for i in range(0,m):
for j in range(0,n):
if (matrix[i][j] == 0):
rows.append(i)
cols.append(j)
for r in rows:
for c in range(0,n):
matrix[r][c] = 0
for c in cols:
for r in range(0,m):
matrix[r][c] = 0
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX