코드
from itertools import chain
def solution(board) :
height = len(board)
width = len(board[0])
for h in range(1, height) :
for w in range(1, width) :
if board[h][w] != 0:
board[h][w] += min(board[h-1][w], board[h][w-1], board[h-1][w-1])
return max(chain(*board))**2