백준 6996번: 애너그램 #Python

ColorlessDia·2024년 9월 15일

algorithm/baekjoon

목록 보기
301/808
import sys

T = int(sys.stdin.readline())

for _ in range(T):
    A, B = sys.stdin.readline().rstrip().split()

    if ''.join(sorted(A)) == ''.join(sorted(B)):
        print(f'{A} & {B} are anagrams.')
        continue
    
    print(f'{A} & {B} are NOT anagrams.')

0개의 댓글