본문 바로가기
코딩테스트/SWExpertAcademy

[Python] SWEA 4865 - 글자수

by Ssubini 2022. 4. 13.

[2022.02.17]

T = int(input())
for tc in range(T):
    str1 = input()
    str2 = input()
    board = [0]*100
    for s in range(len(str2)):
        board[ord(str2[s])-65] += 1

    maxcnt = 0
    for c in range(len(str1)):
        if maxcnt < board[ord(str1[c])-65]:
            maxcnt = board[ord(str1[c])-65]

    print(f'#{tc+1} {maxcnt}')

댓글