https://school.programmers.co.kr/learn/courses/30/lessons/42578
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
def solution(clothes): # [의상의 이름, 의상의 종류]
tempt = {}
for cloth in clothes:
if cloth[1] in tempt:
tempt[cloth[1]] += 1
else:
tempt[cloth[1]] = 2 # 입은 경우, 안 입은 경우 2가지
answer = 1
for value in tempt.values():
answer *= value
return answer-1
'프로그래머스' 카테고리의 다른 글
프로그래머스 42839. 소수 찾기 (0) | 2025.01.14 |
---|---|
프로그래머스 42579. 베스트앨범 (0) | 2025.01.14 |
프로그래머스 42577. 전화번호 목록 (0) | 2025.01.09 |
프로그래머스 42576. 완주하지 못한 선수 (0) | 2025.01.04 |
프로그래머스 1845. 폰켓몬 (0) | 2025.01.04 |