from collections import Counter
def solution(clothes):
count = {} # kind: item
answer = 1
for cloth in clothes:
item, kind = cloth[0], cloth[1]
if kind in count:
count[kind].append(item)
else:
count[kind] = [item]
for i in count.keys():
answer *= len(count[i])+1
return answer -1
#yellow hat: head
#sunglasses: eye
#turban: head
#head: yellow hat, turban
#eye: sunglasses
#answer = answer * (yellow hat, turban+1) = 3
#answer = 3 * (sunglasses +1) = 6