문제 : [SWEA D3] 1216. [S/W 문제해결 기본] 3일차 - 회문2
def fun(num):
for i in range(99, 1, -1):
for j in range(0, 99):
front = j
end = front + i
if end > 99:
break
else:
for n in num:
count = 0
front = j
end = front + i
while True:
if n[front] == n[end]:
count += 1
if count == (i + 1) // 2:
return i + 1
else:
front += 1
end -= 1
else:
break
return 1
for i in range(10):
t = int(input())
length = 1
num = [input() for _ in range(100)]
length1 = fun(num)
num = list(map(list, zip(*num)))
length2 = fun(num)
if length1 > length2:
length = length1
else:
length = length2
print(f"#{t} {length}")