백준 '9375번, 패션왕 신해빈' 문제와 완전 똑같기 때문에 풀이도 똑같다.
해당 문제 풀이는 여기 참고!
def solution(clothes):
closet = {}
for cloth, type in clothes:
if type not in closet:
closet[type] = 1
closet[type] += 1
answer = 1
for k, v in closet.items():
answer *= v
return answer - 1
'Algorithm > Programmers' 카테고리의 다른 글
[프로그래머스/Python] 구명보트 (0) | 2023.09.21 |
---|---|
[프로그래머스/Python] 베스트앨범 (0) | 2023.09.13 |
[프로그래머스/Python] 전화번호 목록 (0) | 2023.09.12 |
[프로그래머스/Python] 뒤에 있는 큰 수 찾기 (0) | 2023.09.05 |
[프로그래머스/Python] 스택/큐 (0) | 2023.09.05 |