ํ’€์ด

์‰ฌ์›Œ์„œ ํŒจ์Šค. ํ•ด์‹œ์‚ฌ์šฉ ๋ฌธ์ œ์ด๋‹ค.

Code

def solution(clothes):
    cloth_dict = dict()
    for c in clothes:
        value, key = c
        if key not in cloth_dict:
            cloth_dict[key] = []
        cloth_dict[key].append(value)
    ans = 1
    for c in cloth_dict:
        ans *= (len(cloth_dict[c])+1)
    return ans-1