participant = ['tom', 'peter', 'spiderman', 'tom']
Counter(participant) => {'tom': 2, 'peter':1, 'spiderman':1}
name = 'apple'
Conter(name) => {'a':1, 'e':1, 'l':1, 'p':2}
Counter는 dict의 하위 클래스로 생성시 O(n)의 시간 복잡도를 가진다.
(출처: https://nero.devstory.co.kr/post/pl-python-collections-counter/)
from collections import Counter
def solution(participant, completion):
answer = list((Counter(participant) - Counter(completion)).keys())[0]
return answer