2018~2019/Level 2

위장 [Python3]

전기도둑 2018. 10. 1. 22:56
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def solution(clothes):
    answer = 1
    category = dict()

    for i in clothes:
        if i[1] in category:
            category[i[1]] += 1
        else:
            category[i[1]] = 1

    for num in category.values():
        answer *= num+1

    return answer-1