Skip to content

Commit 295d564

Browse files
committed
[BOJ] 1302 베스트셀러 (S4)
1 parent ef9849d commit 295d564

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

심수연/5주차/260127.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://www.acmicpc.net/problem/1302
2+
3+
import sys
4+
input = sys.stdin.readline
5+
6+
N = int(input())
7+
8+
dict = {}
9+
10+
for i in range(N):
11+
book = input()
12+
if book in dict:
13+
dict[book] += 1
14+
else:
15+
dict[book] = 1
16+
17+
print(min(dict, key=lambda x: (-dict[x], x)))

0 commit comments

Comments
 (0)