Skip to content

Commit a8a46db

Browse files
committed
Runtime: 1147 ms (Top 25.09%) | Memory: 14.8 MB (Top 29.59%)
1 parent 3df68a5 commit a8a46db

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
# Runtime: 1147 ms (Top 25.09%) | Memory: 14.8 MB (Top 29.59%)
12
class Solution:
23
def imageSmoother(self, img: List[List[int]]) -> List[List[int]]:
34
m, n = len(img), len(img[0])
4-
5+
56
def avg(i, j):
67
s = squares = 0
78
top, bottom = max(0, i - 1), min(m, i + 2)
@@ -11,7 +12,7 @@ def avg(i, j):
1112
for y in range(left, right):
1213
s += img[x][y]
1314
squares += 1
14-
15+
1516
return s // squares
16-
17+
1718
return [[avg(i, j) for j in range(n)] for i in range(m)]

0 commit comments

Comments
 (0)