def solution(clothes):
dictionary = {}
for cloth in clothes:
if cloth[1] not in dictionary.keys():
dictionary[cloth[1]] = [cloth[0]]
else:
dictionary[cloth[1]].append(cloth[0])
count_dict = []
for key,value in dictionary.items():
count_dict.append(len(value)+1)
result = 1
for count in count_dict:
result *= count
return result-1
Counter쓰고 싶었는데....
와인 마셔서 취해서 기억이 안났다
ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
'Code IT > Algorithm' 카테고리의 다른 글
[프로그래머스] 신고 결과 받기 (Python) (0) | 2022.07.22 |
---|---|
[프로그래머스] 기능개발 (Python) (0) | 2022.03.13 |
[구름에듀] 빙글빙글1 (Python) (0) | 2022.03.12 |
[구름에듀] 놀이공원 (Python) (0) | 2022.03.11 |
[프로그래머스] 가장 큰 수 - Sort (Java) (0) | 2021.11.04 |
댓글