BOJ - 2804 - 크로스워드 만들기

Updated:

def solution():
    A, B = map(str, input().split(' '))

    Table = [['.' for _ in range(len(A))] for _ in range(len(B))]

    flag = False

    for posA in range(len(A)):
        for posB in range(len(B)):
            if A[posA] == B[posB]:
                flag = True
                break
        if flag:
            break

    Table[posB] = list(A)
    for i in range(len(B)):

        Table[i][posA] = B[i]

    for t in Table:
        print(*t, sep='')
solution()

https://www.acmicpc.net/problem/2804

Categories:

Updated:

Leave a comment