Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- axios
- redux
- 자바
- 항해99
- 매일메일
- createSlice
- java
- react-router
- useDispatch
- 항해플러스
- redux-saga
- react-redux
- 리액트
- redux-toolkit
- 테코테코
- programmers
- 프로그래머스
- 알고리즘
- react
- sw expert academy
- JavaScript
- 이코테
- 코딩테스트합격자되기
- SW
- maeil-mail
- json-server
- Get
- C++
- Python
- Algorithm
Archives
- Today
- Total
Binary Journey
[프로그래머스] 위장 본문
반응형
출처: 프로그래머스 코딩 테스트 연습, https://programmers.co.kr/learn/challenges
def solution(clothes):
categories = dict()
spi_woredrobe = dict()
answer = 1
for c in clothes:
if not c[1] in spi_woredrobe:
spi_woredrobe[c[1]] = set()
categories[c[1]] = 0
if not c[0] in spi_woredrobe[c[1]]:
spi_woredrobe[c[1]].add(c[0])
categories[c[1]] += 1
for val in categories.values():
answer *= (val + 1)
return answer - 1
반응형
'프로그래머스 > level 2' 카테고리의 다른 글
[프로그래머스] 전화번호 목록 (0) | 2022.04.21 |
---|---|
[프로그래머스] 삼각달팽이 (1) | 2022.04.21 |
[프로그래머스] 더 맵게 (0) | 2022.04.20 |
[프로그래머스] 조이스틱 (0) | 2022.03.10 |
[프로그래머스] 가장 큰 수 (0) | 2022.03.10 |