def solution(clothes):
    answer = 1
    closet = {}
    for cloth,cat in clothes:
        if cat not in closet:
            closet[cat] = [cloth]
        else:
            closet[cat].append(cloth)

    for key in closet.keys():
        answer *= (len(closet[key])+1)

    return answer -1
a9cad8f643ae4eca474e3588ace111e5f565001f
<mask token>

def solution(clothes):
    answer = 1
    closet = {}
    for cloth, cat in clothes:
        if cat not in closet:
            closet[cat] = [cloth]
        else:
            closet[cat].append(cloth)
    for key in closet.keys():
        answer *= len(closet[key]) + 1
    return answer - 1

def solution(clothes):
    answer = 1
    closet = {}
    for cloth,cat in clothes:
        if cat not in closet:
            closet[cat] = [cloth]
        else:
            closet[cat].append(cloth)

    for key in closet.keys():
        answer *= (len(closet[key])+1)

    return answer -1