Skip to content

Instantly share code, notes, and snippets.

@yungyungGwon
Created September 30, 2021 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yungyungGwon/3d4a9bc09c72496585fbd9f2c3136d54 to your computer and use it in GitHub Desktop.
Save yungyungGwon/3d4a9bc09c72496585fbd9f2c3136d54 to your computer and use it in GitHub Desktop.
def solution(board):
n = len(board) #행의 길이
m = len(board[0]) #열의 길이
#2중 for문으로 연산
for i in range(1, n):
for j in range(1, m):
if board[i][j] == 1:
board[i][j] = min(board[i-1][j-1], board[i-1][j], board[i][j-1]) + 1
# 최대 넓이
answer = 0
for i in range(n):
temp = max(board[i])
answer = max(answer, temp)
return answer**2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment