This commit is contained in:
Justin Lin
2026-05-02 15:42:52 +10:00
commit 8582780ac9
38 changed files with 460 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
n = int(input())
f = [input() for _ in range(n)]
# Continue your code here and print your final answer!
counts = {}
for l in f:
if l in counts:
counts[l] += 1
else:
counts[l] = 1
mk = ""
ma = -1
for k in counts:
if counts[k] > ma or (counts[k] == ma and k < mk):
mk = k
ma = counts[k]
print(mk)