-
-
Save yungyungGwon/3d4a9bc09c72496585fbd9f2c3136d54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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