컴공생의 다이어리
[프로그래머스] 완주하지 못한 선수 - 파이썬(Python) 본문
728x90
[프로그래머스] 완주하지 못한 선수 - 파이썬(Python)

import collections
def solution(participant, completion):
answer = collections.Counter(participant) - collections.Counter(completion)
return list(answer.keys())[0]
https://programmers.co.kr/learn/courses/30/lessons/42576
코딩테스트 연습 - 완주하지 못한 선수
수많은 마라톤 선수들이 마라톤에 참여하였습니다. 단 한 명의 선수를 제외하고는 모든 선수가 마라톤을 완주하였습니다. 마라톤에 참여한 선수들의 이름이 담긴 배열 participant와 완주한 선수
programmers.co.kr
728x90
반응형
'Development > Algorithm & Coding Test' 카테고리의 다른 글
[프로그래머스] 위장 - 파이썬(Python) (0) | 2022.05.06 |
---|---|
[프로그래머스] 전화번호 목록 - 파이썬(Python) (0) | 2022.05.05 |
[프로그래머스] 카펫 - 파이썬(Python) (0) | 2022.05.03 |
[파이썬, Python] 백준 2075번 : N번째 큰 수 (0) | 2022.05.02 |
[파이썬, Python] 백준 1012번 : 유기농 배추 (0) | 2022.05.01 |