반응형
https://programmers.co.kr/learn/courses/30/lessons/42576
collections의 Counter() 함수를 사용하여 리스트의 차집합을 구한 후 미완주자의 명단을 쉽게 확인 할 수 있다.
from collections import Counter
def solution(participant, completion):
return list((Counter(participant)-Counter(completion)).keys())[0]
반응형
'Online-Judge > Programmers' 카테고리의 다른 글
[Programmers] Python 카펫 (0) | 2022.06.15 |
---|---|
[Programmers] Python K번째수 (0) | 2022.06.15 |
[Programmers] Python JadenCase 문자열 만들기 (0) | 2022.06.14 |
[Programmers] Python 최솟값 만들기 (0) | 2022.06.11 |
[Programmers] Python 3진법 뒤집기 (0) | 2022.06.11 |
댓글