๋ฌธ์
https://school.programmers.co.kr/learn/courses/30/lessons/42578
ํ์ด
# ํ๋ก๊ทธ๋๋จธ์ค 2๋จ๊ณ - ์์ฅ
def solution(clothes):
answer = 1
dic = {}
for v, k in clothes:
if not k in dic: # ์ฒ์์ผ ๊ฒฝ์ฐ ๋์
๋๋ฆฌ ์ด๊ธฐํ
dic[k] = 0
dic[k] += 1
for v in dic.values():
answer *= v + 1
return answer - 1
'๐๏ธ Algorithm > โฌ ํ๋ก๊ทธ๋๋จธ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
โฌ [Programmers] [Python] [Level3] ์ต๊ณ ์ ์งํฉ (0) | 2023.04.06 |
---|---|
โฌ [Programmers] [Python] Level2_์ฐ์ ๋ถ๋ถ ์์ด ํฉ์ ๊ฐ์ (0) | 2023.04.06 |
โฌ [Programmers] [Python] Level2_๊ทค ๊ณ ๋ฅด๊ธฐ (0) | 2023.04.06 |
โฌ [Programmers] [BFS/DFS] [Python] Level2_H-Index (0) | 2023.02.14 |
โฌ [Programmers] [BFS/DFS] [Python] Level3_๋คํธ์ํฌ (0) | 2023.02.11 |