1. 문제 설명
https://www.acmicpc.net/problem/13414
2. 아이디어
중복을 체크하면서 순서까지 정해줄 수 있을만한 자료형이 뭘까 하다가 딕셔너리를 사용했다.
파이썬을 사용해본지 한 달도 채 안 되던 때라 문제보단 dict 사용법 찾아다니느라 오래 걸렸었다.
딕셔너리 말고 다른 좋은 방법도 충분히 많겠지만, 난 모르겠다~~~
3. 코드
import sys
input = sys.stdin.readline
# 딕셔너리 자료구조로 구현
def solution():
k, l = map(int, input().split())
section = {}
for number in range(l): # 중복 key가 있다면 기존 값 제거
section[input().rstrip()] = number
section = sorted(section.items(), key=lambda x: x[1])
cnt = 0
for key in section:
if cnt == k:
break
print(key[0])
cnt += 1
solution()