/ ALGORITHM

프로그래머스 - 위장

image-20230125194416214

from collections import defaultdict

def solution(clothes):
    cloth = defaultdict(list)
    for i in clothes:
        cloth[i[1]].append(i[0])
   
    cloth = list(cloth.values())
    answer=1
    for i in range(len(cloth)):
        answer*=(1+len(cloth[i]))
    
    return answer-1