| ps | |
|---|---|
| 링크 | acmicpc.net/… |
| 출처 | BOJ |
| 문제 번호 | 11652 |
| 문제명 | 카드 |
| 레벨 | 실버 4 |
| 분류 |
기초 |
| 시간복잡도 | O(n) |
| 인풋사이즈 | n<=100,000 |
| 사용한 언어 | Python |
| 제출기록 | 43472KB / 168ms |
| 최고기록 | 124ms |
| 해결날짜 | 2022/04/09 |
"""Solution code for "BOJ 11652. 카드".
- Problem link: https://www.acmicpc.net/problem/11652
- Solution link: http://www.teferi.net/ps/problems/boj/11652
"""
import collections
import sys
def main():
N = int(sys.stdin.readline())
nums = [int(sys.stdin.readline()) for _ in range(N)]
counter = collections.Counter(nums)
print(max(counter, key=lambda x: (counter[x], -x)))
if __name__ == '__main__':
main()