세용용용용
2023. 7. 7. 20:48



def solution(clothes):
answer = 1
dict_clothes = {}
for i in clothes:
if i[1] not in dict_clothes:
dict_clothes[i[1]] = 1
else:
dict_clothes[i[1]] += 1
for i in dict_clothes.values():
answer = answer*(i+1)
answer -= 1
#print(answer)
return answer
solution([["yellow_hat", "headgear"],
["blue_sunglasses", "eyewear"],
["green_turban", "headgear"]])