-Code
for t in range(1, int(input()) + 1):
n = int(input())
max_len = 0
res = ""
for _ in range(n):
name = input()
name_set = set(list(name))
name_set.discard(' ')
if max_len < len(name_set):
max_len = len(name_set)
res = name
elif max_len == len(name_set) and res > name:
res = name
print(f"Case #{t}: {res}")
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 4841번 Look and Say (0) | 2024.01.15 |
---|---|
[백준/파이썬] 6765번 Icon Scaling (0) | 2024.01.14 |
[백준/파이썬] 18884번 New Year and Naming (0) | 2024.01.12 |
[백준/파이썬] 9783번 Easy Encryption (0) | 2024.01.11 |
[백준/파이썬] 12184번 GBus count (Small) (1) | 2024.01.10 |