반응형
onprogrammers.co.kr/learn/courses/30/lessons/42576
코딩테스트 연습 - 완주하지 못한 선수
수많은 마라톤 선수들이 마라톤에 참여하였습니다. 단 한 명의 선수를 제외하고는 모든 선수가 마라톤을 완주하였습니다. 마라톤에 참여한 선수들의 이름이 담긴 배열 participant와 완주한 선수
programmers.co.kr
from collections import Counter
def solution(participant, completion):
return list(Counter(participant) - Counter(completion))[0]
반응형
'코딩 테스트 > 프로그래머스' 카테고리의 다른 글
[프로그래머스 Python] - 괄호변환(2020 KAKAO BLIND RECRUITMENT) (0) | 2020.11.23 |
---|---|
[프로그래머스 Python] - 더 맵게(heap) (0) | 2020.11.05 |
[프로그래머스 Python] - 전화번호 목록 (0) | 2020.10.30 |
프로그래머스 - 예산[Python] (0) | 2020.07.07 |
프로그래머스 - 가장 먼 노드[Python] (0) | 2020.07.06 |