class Solution(object):
def check_type(self, i, j, row_len, col_len) :
#3가지 형식으로 나눔
if i == 0 and j == 0 :
return 1
elif i == 0 and j == (row_len - 1) :
return 1
elif i == (col_len - 1) and j == 0 :
return 1
elif i ==
def imageSmoother(self, M):
"""
:type M: List[List[int]]
:rtype: List[List[int]]
"""
row_len = len(M)
col_len = len(M[0])
for i, row in M :
for j, col in row :
if check_type(i, j, row_len, col_len) == 1 :
문제 풀이
def imageSmoother(self, M): """ :type M: List[List[int]] :rtype: List[List[int]] """ row_len = len(M) col_len = len(M[0]) for i, row in M : for j, col in row : if check_type(i, j, row_len, col_len) == 1 :
4귀퉁이