Skip to content

Commit 10a8708

Browse files
gusdn3477Heongilee
authored andcommitted
1주차_숫자 정사각형(1051)
1 parent e8c424b commit 10a8708

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
def find_Max(s):
2+
3+
for x in range(N):
4+
for y in range(M):
5+
6+
if x + i >= N:
7+
continue
8+
9+
elif y + i >= M:
10+
continue
11+
12+
if arr[x][y] == arr[x+i][y] and arr[x][y] == arr[x][y+i] and arr[x][y] == arr[x+i][y+i]:
13+
return (i+1) ** 2
14+
15+
return -1
16+
17+
18+
N,M = map(int, input().split())
19+
arr = []
20+
21+
for i in range(N):
22+
arr.append(list(map(int, input())))
23+
24+
s = min(N,M)
25+
26+
for i in range(s-1,-1,-1):
27+
t = find_Max(i)
28+
29+
if t != -1:
30+
print(t)
31+
break

0 commit comments

Comments
 (0)