백준 15238번: Pirates #Python

ColorlessDia·2025년 12월 28일

algorithm/baekjoon

목록 보기
770/807
N = int(input())
S = input()

char_set = set()
char_count = {char: S.count(char) for char in S if char not in char_set}
char, count = sorted(char_count.items(), key=lambda x: -(x[1]))[0]

print(char, count)

0개의 댓글