강의

멘토링

커뮤니티

Inflearn Community Q&A

mw3100162's profile image
mw3100162

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

11. Lattice Palindrome

격자판 회문수 풀이

Written on

·

408

0

a=[list(map(int, input().split())) for _ in range(7)]
res=0
def check(a):
    res=0
    for i in range(3):
        temp=a[i:i+5]
        temp.reverse()
        if temp==a[i:i+5]:
            res+=1
        else:
            res+=0
    return res
for i in range(7):
    temp=list([0]*7)
    temp2=list([0]*7)
    for j in range(7):
        temp[j]=a[i][j]
        temp2[j]=a[j][i]
    res+=check(temp)
    res+=check(temp2)
print(res)
            

이렇게 풀어도 괜찮을까요??

python코딩-테스트코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

네. 이 문제는 시간복잡도를 따지는 문제는 아니라 구현력이니 답만 나온다면 상관없습니다.

mw3100162's profile image
mw3100162

asked

Ask a question