[프그] 해쉬 : 위장

yozzum·2022년 7월 19일
0
def solution(clothes):
    clothes_type = {}

    for c, t in clothes:
        if t not in clothes_type:
            clothes_type[t] = 1 # 해당 타입을 안입었을 때
            clothes_type[t] += 1 # 해당 의류를 입었을 때
            
        else:
            clothes_type[t] += 1 # 해당 의류를 입었을 때

    cnt = 1
    for num in clothes_type.values():
        cnt *= num

    return cnt - 1
profile
yozzum

0개의 댓글