[Python] 피시방 알바 - 백준 1453

찐새·2022년 6월 12일
0

코딩테스트

목록 보기
12/53
post-thumbnail

피시방 알바 - 백준 1453

풀이

from collections import Counter

guest = int(input())
seat = list(map(int, input().split()))
c = Counter(seat).most_common()
cnt = 0
for i in c:
    if i[1] > 1:
        cnt += i[1] - 1

print(cnt)
  • Counter(list).most_common() : list 요소를 세고, 가장 많은 순의 튜플을 리스트에 담아 반환한다.
profile
프론트엔드 개발자가 되고 싶다

0개의 댓글